TestMailHelper

TestMailHelper is a Python package designed for easy interaction with the Testmail.app API. It simplifies the process of retrieving email lists and fetching specific emails using the API.

Features

Installation

You can install it using pip:

pip install TestMailHelper

Usage

Here’s a basic example of how to use the TMClient class provided by the TestMailHelper package:

from testmailhelper import TMClient

def main():
    client = TMClient(
        api_key='your_api_key',
        namespace='your_namespace'
    )
    
    # Get a list of emails
    emails = client.get_emails_list()
    print("Email List:")
    for email in emails:
        print(email)
    
    # Get a specific email by ID
    email_id = 'some_email_id'
    email = client.get_email_by_id(email_id)
    if email:
        print("Email Details:")
        print(email)
    else:
        print(f"No email found with ID: {email_id}")
    
    # Get emails by tag
    tag = 'some_tag'
    tagged_emails = client.get_emails_by_tag(tag)
    print(f"Emails with tag '{tag}':")
    for email in tagged_emails:
        print(email)

if __name__ == "__main__":
    main()

API Reference

TMClient

__init__(api_key, namespace)

Initialize the TMClient with your API key and namespace.

get_emails_list()

Retrieve a list of emails from the Testmail API.

get_email_by_id(email_id)

Retrieve a specific email by its ID.

get_emails_by_tag(tag)

Retrieve a list of emails with a specific tag.

Contributing

Contributions are welcome! Please open an issue or submit a pull request if you have suggestions or improvements.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contact

For questions or support, please contact Muhammad Ali.