Skip to main content
Warning: You are using the test version of PyPI. This is a pre-production deployment of Warehouse. Changes made here affect the production instance of TestPyPI (testpypi.python.org).
Help us improve Python packaging - Donate today!

Django module to easily send templated emails.

Project Description

Django module to easily send templated emails in a DRY way using classes, just like Class Based Views.

Table of contents:

How to install

To install the app run :

pip install django-mailings

or add it to the list of requirements of your project.

Example usage

Use the BaseMailing class to define your email like:

from mailings.mailings import BaseMailing

class ExampleEmail(BaseMailing):
    """ """
    template_name = "myapp/mails/myemail.html"
    subject = "Example subject of email"

And send it using:

ExampleEmail().send(['example@example.com'])

Where ['example@example.com'] is a list of emails of destination or a object with get_mailing_list method defined

Settings reference

To give support to this app we need to declare de following django settings:

DEFAULT_FROM_EMAIL = "example@example.com"

MAILINGS = {
    'DEFAULT_REPLY_TO': "examplereplyto@example.com",
    'DEFAULT_SUJECT': "Example subject",
    'BASE_URL': "https://domain.com",
    'EXTRA_DATA': {},
    'WHITELIST': []
}
  • DEFAULT_FROM_EMAIL: Default setting of Django that defines the from email
  • DEFAULT_REPLY_TO: Default reply to be used on emails
  • DEFAULT_SUJECT: Default subject to be used on emails
  • WHITELIST: List of valid emails to send to
  • BASE_URL: The base url of your website
  • EXTRA_DATA: Any extra data intended to be used on all emails (This is injected on context of template)

License

MIT license, see the LICENSE file. You can use obfuscator in open source projects and commercial products.

Release History

This version
History Node

0.1.0.dev1

Download Files

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

File Name & Hash SHA256 Hash Help Version File Type Upload Date
django_mailings-0.1.0.dev1-py2-none-any.whl
(11.2 kB) Copy SHA256 Hash SHA256
py2 Wheel Sep 14, 2017
django-mailings-0.1.0.dev1.tar.gz
(7.1 kB) Copy SHA256 Hash SHA256
Source Sep 14, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting