Skip to main content

A simple Django app to create and send editable emails.

Project description

Django HTML Email Templates

A Django app for allowing users to create html emails using Django template variables passed in to the context.


Use the package manager pip to install django-html-emailtemplates.

pip install django-html-emailtemplates

Add the package to your INSTALLED_APPS



from emailtemplates.fields import EmailTemplateField
class Settings(models.Model):
    contact_form_reply = EmailTemplateField(
        You can use the following variables in the template:
        {{ name }}
        {{ subject_matter }}
        {% for item in items %}
            Possible values are:
            {{ item.title }}
            {{ item.cost }}
            {{ item.description }}
        {% endfor %}

from emailtemplates.utils import send_email_template
from emailtemplates.models import EmailTemplate
from .models import Settings

# view definition
def form_valid(self, form):
    enquiry =
    # send reply email to website user
            'subject_matter': enquiry.subject,
            'items': [
                    'title': 'Product',
                    'cost': '£20.00',
                    'description': 'Product description...'
    # send notification to website owner
            subject='Enquiry from',
                <p>There was an enquiry on your website, the details are below:</p>
                            <td>{{ }}</td>
            'enquiry': enquiry

alt text

Features to add

  • [ ] Add custom ForeignKey field to display the context that can be used
  • [ ] Add base email header/footer
  • [ ] Add plugins for images/documents
  • [ ] Add better html field
  • [ ] Add support for Wagtail StreamField

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-html-emailtemplates, version 0.0.2
Filename, size File type Python version Upload date Hashes
Filename, size django-html-emailtemplates-0.0.2.tar.gz (8.7 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