Skip to main content

Make sending html emails easy.

Project description

TODO: make the docs nicer

Deadsimple html email sending.

add emailit for the bundled templates and absolute for easy full absolute urls to INSTALLED_APPS.

usage:

import emailit.api
context = {
    'my_obj': 'whatever',
}
emailit.api.send_mail(['email@domain.com'], context, 'mymails/example_email')

now add these templates:

mymails/example_email.body.html
mymails/example_email.body.txt
mymails/example_email.subject.txt

the convention is, that the body templates should extend emailit/base_email.body.html / emailit/base_email.body.txt and overrid the content block. This makes it easy to provide a site-wide look to all emails using this system by overriding emailit/base_email.body.*.

If the body.html template is not found, a simple text email is sent. If the body.txt template is missing, it will be a pure html email.

HTML emails are passed through premailer.

language can be passed into the send_mail function to override the active language while rendering the mail.

The body templates will contain the rendered subject variable in their context. subject can also be passed directly into send_mail.

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-emailit-0.1a3.tar.gz (4.7 kB view details)

Uploaded Source

File details

Details for the file django-emailit-0.1a3.tar.gz.

File metadata

File hashes

Hashes for django-emailit-0.1a3.tar.gz
Algorithm Hash digest
SHA256 6c88025a3801927006767a25a7c02d9e516dc18cc2a0a807ce34156626fb007b
MD5 fd8edabc995782b9508ffc41bcb82791
BLAKE2b-256 4789b0f36f5ee56337f9a7b3902f781bddc8e1e72bb093f7012ef4f6e98b6d6f

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