Skip to main content

A Drop in Replacement for default django email backend based on Amazon SES

Project description

Build Status codecov

Django Ses

Another Django Email Backend on top of Amazon Simple Email Service (SES). Supports Django 1.9, 1.10, 1.11, 2.0, 2.1 . Using the latest boto3 to make API Calls, Tested using moto

What is this package about

Every web application needs to send email at some point, may it be verification, password resets, updates etc..., Django by default supports SMTP protocol, simply specify smtp credentials and you are ready to go. But when you use Amazon Services such as SES the preferred way is to access it via its API.

So Here it is guys. Simply install it, give the SES credentials, and start sending Emails. More over if your application is hosted in AWS first ~60000 emails are free every month

Table of Contents

Installation

This package is available via pip, So install it using pip

pip install django-ses

and add it in your INSTALLED_APPS section of settings.py

INSTALLED_APPS = [
    'django_ses',
     ...
]

SES Credential Setup

Obviously you need to have access to an AWS SES account, generate credentials by following this guide or if you already have access keys use it.

in your settings.py add it as follows

SES_ACCESS_KEY = 'xxx'
SES_SECRET_KEY = 'xxx'
SES_REGION_NAME = 'us-east-1'  

SES_REGION_NAME is optional defaults to us-east-1

You need to verify domain or verify email in order to send emails outside

Usage

Once the setup is done you can send emails as usual, your existing calls to emails should work without any modifications

example 1 - Using send_mail()

send_mail(subject="Test Subject", message="Message", from_email="from@example.com", recipient_list=['to@example.com'])

example 2 - Using EmailMessage

email = EmailMessage(
    'Subject 1',
    'Body1 goes here',
    'from@example.com',
    ['to1@example.com', 'to2@example.com'],
    reply_to=['another@example.com'],
)

email.send()

https://docs.djangoproject.com/en/2.1/topics/email for more details

TODO

  • Pre Send, Post Send Signals

Contribution

  • Submit issues to Github Issues
  • Submit patches to the develop branch
  • Kindly write tests to justify any additions

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

django_ses_email_backend-0.0.1.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_ses_email_backend-0.0.1-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file django_ses_email_backend-0.0.1.tar.gz.

File metadata

  • Download URL: django_ses_email_backend-0.0.1.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.5

File hashes

Hashes for django_ses_email_backend-0.0.1.tar.gz
Algorithm Hash digest
SHA256 13c11c1a35f0395fdacce6e16844074356ea67f6656adb3efbe93ad3bf56fa2c
MD5 84df1ac87d3e0898a9b332e4ace9ccff
BLAKE2b-256 f87aa6b84d8fd7e6ae1cba7bc9594c8b28959b65ba121a621b64e0bfc15c0f97

See more details on using hashes here.

File details

Details for the file django_ses_email_backend-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: django_ses_email_backend-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.5

File hashes

Hashes for django_ses_email_backend-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 788c98b13bc862a88a35084866530d471fed62853547389f31d90bf720a175d5
MD5 9b7d4ff60e26aa04f27293e851941061
BLAKE2b-256 78e6ed4012a709d7c72511028da5b8730d49e578b28af0fc2fdae95d2a5878ee

See more details on using hashes here.

Supported by

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