Skip to main content

Provides easy interface for sending emails through Amazons Simple Email Service.

Project description

UA-Email-Client

Provides easy interface for sending emails through Amazons Simple Email Service.

Motivation

To make a python API that could obfuscate the details of sending emails using AWS SES service.

Code Example

from ua_email_client import ua_email_client

client = ua_email_client.EmailClient(email)
# The template name given should be relative name to a file.
client.add_template("success.html")

# Destinations
client.send_email(destinations, "success.html", subject, body)
# No Template
client.send_email(destinations, None, subject, body, use_template=False)

Installation

pip install --user ua-email-client

Tests

NOTE: Running this test suite WILL send emails. Please specify an email which can receive emails. The emails can all be ignored once received.

To run the tests you will need to create a json configuration with some user-specific values. This file will be ua_email_client/tests/email_creds.json. It will be populated with:

{
    "email": "...",
    "default_recipient": "...",
    "secondary_recipient": "..."
}

Where "email" is the sending email, "default_recipient" is the main email you want to receive emails, and "secondary_recipient" is a second email to test sending emails to multiple recipients at once.

Once this file is created, just run:

cd ua_email_client/tests
nosetests test_ua_email_client.py

Credits

RyanJohannesBland EtienneThompson

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ua_email_client-0.1.9.tar.gz (4.3 kB view hashes)

Uploaded Source

Built Distribution

ua_email_client-0.1.9-py3-none-any.whl (6.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page