Skip to main content

An email manager for sending emails with templates, mail history and admin.

Project description

https://badge.fury.io/py/django-saas-email.svg https://travis-ci.org/unicorn-supplies/django-saas-email.svg?branch=master https://codecov.io/gh/unicorn-supplies/django-saas-email/branch/master/graph/badge.svg

An email manager for sending emails with templates, mail history and admin.

Features

Documentation

The full documentation is at https://django-saas-email.readthedocs.io.

Quickstart

Installation

Installation with pip:

pip install django-saas-email

Add it to your INSTALLED_APPS:

INSTALLED_APPS = (
    ...
    'django_saas_email.apps.DjangoSaasEmailConfig',
    ...
)

JSONField

We are using the Postgres JSONField as default. If you installed psycopg2, everything should work fine.

If you are using a different database, you also need to install jsonfield:

pip install jsonfield

Adding the Sendgrid API Key to your settings

In settings.py:

SENDGRID_API_KEY=<....>

Other optional settings:

DJANGO_SAAS_TEST_EMAIL_ADDRESS=youremailfortesting@example.org
DJANGO_SAAS_FOOTER="""Follow <a href="#" style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 12px; color: #999; text-decoration: underline; margin: 0;">@yourcompany</a> on Twitter"""

Sending emails

Basic example:

from django_saas_email.utils import create_and_send_emails

context={
    'first_name': 'John',
    'last_name': 'Doe',
}

create_and_send_mail(
    template_name="hello_world",
    context=context,
    to_address=john.doe@example.org
)

This will create an email and send it with Sengrid.

You should use http://premailer.dialect.ca or django-premailer to create Inline CSS in HTML

Running Tests

Does the code actually work?:

source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ tox

History

0.1.0 (2017-07-24)

  • First release on PyPI.

Project details


Download files

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

Files for django-saas-email, version 0.1.2
Filename, size File type Python version Upload date Hashes
Filename, size django_saas_email-0.1.2-py2.py3-none-any.whl (17.1 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size django-saas-email-0.1.2.tar.gz (14.1 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page