This small module is inspired by my need for sending templated emails, with the
option of attaching an HTML formatted alternative.
Installation
=============
Installing::
pip install django-email-templates
Example usage
==============
The following example demonstrates how to send a templated email, in this case
the user has submitted a contact form. The module will look for the templates
contact.txt and contact.html which will serve as the plaintext and html alternative
of the email. The default location of the templates is a directory named *email_templates*.::
from email_templates import send_templated_mail
context = {
'name': request.POST['name'],
'email': request.POST['email'],
'telephone': request.POST['phone'],
'message': request.POST['message'],
}
success = send_templated_mail(
'Contact form submission',
None,
[a[1] for a in settings.ADMINS],
'contact',
context
)
option of attaching an HTML formatted alternative.
Installation
=============
Installing::
pip install django-email-templates
Example usage
==============
The following example demonstrates how to send a templated email, in this case
the user has submitted a contact form. The module will look for the templates
contact.txt and contact.html which will serve as the plaintext and html alternative
of the email. The default location of the templates is a directory named *email_templates*.::
from email_templates import send_templated_mail
context = {
'name': request.POST['name'],
'email': request.POST['email'],
'telephone': request.POST['phone'],
'message': request.POST['message'],
}
success = send_templated_mail(
'Contact form submission',
None,
[a[1] for a in settings.ADMINS],
'contact',
context
)
Metadata
Release files for django-email-templates 0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| django-email-templates-0.1.tar.gz | 3.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| django_email_templates-0.1-py2.6.egg | Legacy Egg format | - | - | Details |
Total release size: 7.4 kB
Release files / django-email-templates-0.1.tar.gz
| Download URL | django-email-templates-0.1.tar.gz |
|---|---|
| Size | 3.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5d9128c33f87bfb2a3afb95c50f06df1e48fd7512827b12fb6f1b28de01bb271
|
|
BLAKE2b-256 checksum How to use checksums |
b8a864e02af34e2ba6425b2c5bf13b2d92d7bfe3f4d3855fdee419b070aec4cf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / django_email_templates-0.1-py2.6.egg
| Download URL | django_email_templates-0.1-py2.6.egg |
|---|---|
| Size | 4.0 kB |
| Tags | Egg |
|
SHA-256 checksum How to use checksums |
6c5e7ba9c72b0b2d9d831a97993b4c810a67bf6ba85a6bd907c92309c2280e41
|
|
BLAKE2b-256 checksum How to use checksums |
136afa697d66f7894eeb709505cc73d4b28d048ba96df1f333e706941f9fa2a0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |