Skip to main content

Django Email Templates made easy

Project description

https://badge.fury.io/py/django-email.png https://travis-ci.org/swappsco/django-email.png?branch=master

Django Email Templates made easy

Current Version 0.1.6

Django email is a thin wrapper for django’s multialternative email sending. For this you will need to specify a plain text template (.txt) and an html version (.html). Django email takes your template and your context, renders it and sends the email, reducing the boilerplate required for sending an email.

We try to use defaults that make sense, but you can always adapt things to your needs. You can setup the subject, email from, email to and more.

Your templates must not have extension, but other than that we assume nothing.

Quickstart

Install Django Email:

pip install django-email

Then use it in a project:

from django_email import email as djemail

# Simple Usage
# Admin will receive a message
djemail.send_mail(message="My Message", subject="The Subject")

# Send an email to a specific email
djemail.send_mail(
        to="email@test.com",
        message="My Message",
        subject="The Subject")

# Advanced Usage
djemail.send_email(
    to="email@test.com",
    template_name="path/to/template", # .txt and/or .html
    context={'variable': 'Variable Content'},
    subject="My Subject"
)

Features

  • Send easy email to ADMINS.

  • Send TXT/HTML Email using a predefined template.

  • Send Email using your own custom templates.

Running Tests

Does the code actually work?

source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install -r requirements_test.txt
(myenv) $ python runtests.py

Credits

Tools used in rendering this package:

History

0.1.5 (2016-07-23)

  • 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.

Source Distribution

django-email-0.1.6.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

django_email-0.1.6-py2.py3-none-any.whl (7.6 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file django-email-0.1.6.tar.gz.

File metadata

File hashes

Hashes for django-email-0.1.6.tar.gz
Algorithm Hash digest
SHA256 f845764e622d64b3645d31ab620ee0d80d9ef22deeb385aff36eb72e5ebcfb15
MD5 72eb6a0c0a872f69d4f59c3a20878e10
BLAKE2b-256 d510239250308d10dcfd417be32bc3d5e0c85edd3486f95bbc5cd6be3a079a8a

See more details on using hashes here.

Provenance

File details

Details for the file django_email-0.1.6-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for django_email-0.1.6-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 0293fc66728991701e0b8f2ec67882c38e684f81dfd6c3b2f49a8dcf80777817
MD5 f51549d539ef74a276a0cb3709ac1d4f
BLAKE2b-256 7a9093c4ae7d428af5f955635c9fc96c3509d158f8a26cebdb912daf31522b05

See more details on using hashes here.

Provenance

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