Skip to content

LPgenerator/django-db-mailer

Repository files navigation

Django-Db-Mailer

Build Status

Code Health

Codacy

Python 2.7, 3.4+, pypy, pypy3

Current version on PyPi

Documentation Status

License

Documentation available at Read the Docs.

What's that

Django module to easily send emails/push/sms/tts using django templates stored in a database.
From box you can use it with django-celery for send background messages.
Also you have opportunity to create reports from logs by mail categories and slug.
Groups with Recipients and send by model signal also available by default.
Can be used without any depends from programming language as a external service.
That app very simple to install and use on your projects.

Installation

  1. Using pip:
  1. Add the dbmail application to INSTALLED_APPS in your settings file (usually settings.py)
  2. Sync database (./manage.py migrate).

Mail API

Sms API

Text to speech API

Text to speech supported by default provider. But maybe not supported by your provider.

Push notification API

DBMail Backends

By default django-dbmail used 4 built-in backends (Mail/Sms/Tts/Push). But nothing prevents to write your own backend to work with all that you want.

DBMail Providers

Battery have some built-in providers for most popular services, which will be used without any dependencies with built-in backends.

Push notifications for mobile apps:

  • Apple APNs/APNs2
  • Google GCM
  • Microsoft Tile/Toast/Raw
  • BoxCar
  • Parse

Browser notifications:

  • GCM (Desktop: Google Chrome, FireFox; Mobile: Google Chrome on Android)
  • APNs (Desktop: Safari)
  • Centrifugo
  • PubNub
  • BoxCar
  • PushAll

Notifications for team:

  • Slack/Mattermost
  • Boxcar
  • Prowl
  • Pushover
  • PushAll

SMS notifications:

  • Nexmo
  • Twilio
  • IQsms
  • SmsAero
  • SmsBliss

Mail notifications:

  • SendinBlue
  • Any, which designed as django email backend

You can find providers settings on docs.

Demo installation

Docker

Vagrant

OS X/Linux

Open Shell:

Create new template:

Try to send test email with created template (without celery):

Send email using celery:

Check mail logs:

Open app in browser (login and password is admin/admin):

Additional information

Revision

For support template reversion, you can install django-reversion. Find information about compatibility with your Django versions here.

Editor

To enable editor, you may install and configure django-tinymce or django-ckeditor app.

Theme

django-db-mailer supported from box django-grappelli and django-suit skin. Information about compatibility available here.

Queue

Install and configure django-celery for background message sending with priorities. You can find celery settings examples on demo project. We recommended to use django-celery-mon with django-celery for monitoring celery and supervisor processes.

Premailer

For turns CSS blocks into style attributes, you can install premailer from PyPi.

Translation

For use different language on your mail templates, install django-modeltranslation or grappelli-modeltranslation. Add into settings.py:

Update dbmail fields:

Postmark Django Backend

Install python-postmark app via pip. Configure your settings:

Amazon's Simple Email Service Django Backend

Install django-ses app via pip. Configure your settings:

Note: You can use any backends designed as django email backend

Tracking

For track information about user, or about mail is read, you must be enable logging, and enable tracking on settings.

If you use Django 1.8, you should install geoip package instead of geoip2.

MJML

MJML is a markup language designed to reduce the pain of coding a responsive email. Install django-mjml app via pip and mjml via npm. And configure your settings:

Older versions

Very simple version of this app, available here. That version do not include celery settings, bcc, api, mail settings, signals, mail groups and model browser.

Notes

All app features available only with django-celery and with Redis.

External API usage

API bandwidth is 1k+ rps on i7 2.3GHz

Responsive transactional HTML email templates

Fixtures with Base transactional HTML email templates was added into dbmail fixtures. This templates was optimized for desktop clients, web clients, mobile clients, various devices, various providers. Thanks for Mailgun Team. You can use it as default basic templates on your project.

Publications

Screenshots

image

image

image

image

image

image

image

image

image

image

image

image

image

image

image

image

image

Compatibility

  • Python: 2.7, pypy2.7, 3.4, 3.5, 3.6, 3.7, pypy3.5
  • Django: 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 1.10, 1.11, 2.0, 2.1

About

Django module to easily send emails/sms/tts/push using django templates stored on database and managed through the Django Admin

Resources

License

Stars

Watchers

Forks

Packages

No packages published