Skip to content
This repository has been archived by the owner on Dec 10, 2019. It is now read-only.

Latest commit

 

History

History
18 lines (13 loc) · 833 Bytes

README.md

File metadata and controls

18 lines (13 loc) · 833 Bytes

Store email templates in the database and send it with a simple function call.

Installation

  • Add the app 'database_email' to your INSTALLED_APPS list
  • Migrate the database

Usage

  • Create an email template in the admin. The name field is the name you need to refer to the email in code
  • Send the email with send_email function in the django_database_url.email module

Template format

The email template is a standard django template, with one exception: Every newline gets replaced with a
HTML tag. This makes editing much easier (especially for non-technical people).

In addition, a plain text version of the rendered text is generated using the django utils function strip_tags. To generate correct links in the plain text version, use the following syntax:

<a href="http://example.com">http://example.com</a>