Skip to main content

Simple version of this app without celery settings, bcc, api, mail settings, signals, mail groups and model browser.

Project description

What's that
Django module to easily send emails using django templates stored on database.
From box you can use it with django-celery for send background messages.
Also you have opportunity create reports from logs by mail categories and slug.
That app very simple to install and use on your projects.


1. Using pip:

.. code-block:: bash

$ pip install django-db-mailer

2. Add the ``dbmail`` application to ``INSTALLED_APPS`` in your settings file (usually ````)
3. Sync database (``./ syncdb``)

Usage examples

.. code-block:: python

from dbmail.models import MailTemplate
from dbmail import send_db_mail

# New dbmail template
name="Site welcome template",
message="Welcome to our site. We are glad to see you.",

# Send message with created template
# slug was defined on db template

# recipient can be list, or separated with comma or simple string
# '' or ',' or ['', '']

# All *args params will be accessible on template context
'username': request.user.username,
'full_name': request.user.get_full_name(),
'signup_date': request.user.date_joined

# You can access to all model fields. For m2m and fk fields, you should use module_name

# Optional kwargs:
# from_email=''
# cc=[''],
# bcc=[''],
# user=User.objects.get(pk=1),
# from_email='',
# attachments=[(filename, content, mimetype)],
# headers={'Custom-Header':'Some value'},

Local demo installation

.. code-block:: bash

$ sudo apt-get install virtualenvwrapper
$ mkvirtualenv django-db-mailer
$ git clone
$ cd django-db-mailer
$ python develop
$ cd demo
$ pip install -r requirements.txt
$ python syncdb
$ python migrate
$ python runserver


.. image:: /screenshots/template_edit.jpg
.. image:: /screenshots/templates_changelist.jpg
.. image:: /screenshots/template_log_changelist.jpg
.. image:: /screenshots/template_log_view.jpg

* Python: 2.6, 2.7
* Django: 1.4, 1.5, 1.6

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-db-mailer, version 1.0
Filename, size File type Python version Upload date Hashes
Filename, size django_db_mailer-1.0-py2.py3-none-any.whl (16.9 kB) File type Wheel Python version 2.7 Upload date Hashes View
Filename, size django-db-mailer-1.0.tar.gz (19.1 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page