Django emails with html/txt templates

Django Templated Email is a tool which sends email in django with html/txt templates.

Features:

  • Html / Txt templates
  • Context variables
  • Current site (from sites framework) available in templates as {{ site }} variable

Installation and usage:

Run the following command inside your django’s project directory

  

In setting.py file add “templated_email” to INSTALLED_APPS

Use the function. Example:

Don’t forget to create the template files.

In your templates folder, create a folder named ‘email_templates’.

Place example-template.html or example-template.txt inside of it.

Example: