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

A small useful app to manage email queues with run-time db-stored customizable templates from any django project

License

Notifications You must be signed in to change notification settings

francescocaponio/django-template-email-manager

Repository files navigation

PyPI GitHub Created Badge Downloads Downloads Visits Badge Commits Badge


Django Template Email Manager

Django Template Email Manager

A free and open source app to manage email queues from any django project
Explore the documentation

Table of Content

Info

Template Email Manager is a Django App that manages all the email communications of your Django project. You can create multiple sending accounts, HTML templates with attached images and email receivers. Everything is run-time customizable, since all the parameters are stored in DB. All messages are stored in a DB based queue.

Features

  • Allows you to use multiple source e-mail provider and address on the same Django project
  • Each configured email provider has its own attributes (max send attempts, delay between retries, and so on...)
  • You can add and edit TXT and HTML e-mail templates at run-time, without the need to change the code
  • You can attach picture and/or other format attachment to the e-mails
  • Automatic queue management using Django Background Tasks
  • Storage of all added and processed e-mails with status and logs

Installation and Use

  • Install it from PyPI inside your virtualenv:

      pip install django-template-email-manager
    
  • Add template_email_manager to the list of installed app in your project (INSTALLED_APPS):

      INSTALLED_APPS = [
          ...
          'template_email_manager',
          ...
      ]
    
  • Run python manage.py migrate from your virtualenv to create the database structure.

  • Create your template and save it on your DB and start using it or use the demo fixture

  • Where you want to send templated email add this import:

      from template_email_manager.commands import add_email_to_queue
    

    and add this code to add a mail to the send queue:

          # context dict for the template variables replacement
          context = {
              'var1': value1,
              'var2': value2
          }
          add_email_to_queue('template_name', context)
    

    template_name must much the name of a template stored in the model HTMLTemplate

Please refer to the Docs for detailed info on how to install and use it.