Skip to main content

Queening and storing EMAIL_BACKEND for django.

Project description

Queening and storing EMAIL_BACKEND for django.

https://img.shields.io/pypi/v/django-email-queue.svg https://img.shields.io/travis/wooyek/django-email-queue.svg Documentation Status Coveralls.io coverage CodeCov coverage Maintainability License Tweet about this project https://img.shields.io/badge/Say%20Thanks-!-1EAEDB.svg

No change in django send_messages usage to get message storing

You don’t have to change the way you send messages, this app will plugin into the usual django plumbing.

This way all the email send though django EMAIL_BACKEND will get stored for auditing.

No overhead infrastructure

You don’t have to setup overhead infrastructure (e.g. celery, redis and rabbitmq) just to send emails asynchronously. You can use a simple worker that will send queued emails.

When you get big and having a MQ and all that is a good choice, all you have to to is set EMAIL_QUEUE_EMAIL_BACKEND to ‘djcelery_email.backends.CeleryEmailBackend’. This way you get message storing for auditing and will use pro setup for asynchronously ran tasks.

Quickstart

Install Django email queue:

pip install django-email-queue

This is a plugin replacement for your current EMAIL_BACKEND. You’ll still use it to send actual messages, but before them they’ll get stored and queued in models visible from admin panel.

EMAIL_BACKEND = 'django_email_queue.backends.EmailBackend'
EMAIL_QUEUE_EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'

INSTALLED_APPS = [
    ...
    'django_email_queue.apps.DjangoEmailQueueConfig',
]

Now you have a few options to setup queue processing

  1. Run django_email_queue.worker from terminal to continuously send emails:

python -m django_email_queue.worker

Set EMAIL_QUEUE_SLEEP_TIME to number of settings to sleep between runs.

  1. Run django command to process queue and exit:

python manage.py send_queued_messages
  1. Manually from django admin for :

Deploy Django Opt-out example project to Heroku

Running Tests

Does the code actually work?

$ pipenv install --dev
$ pipenv shell
$ tox

We recommend using pipenv but a legacy approach to creating virtualenv and installing requirements should also work. Please install requirements/development.txt to setup virtual env for testing and development.

Credits

This package was created with Cookiecutter and the wooyek/cookiecutter-django-app project template.

History

0.9.17 (2018-01-02)

  • First release on PyPI.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-email-queue-0.15.0.tar.gz (120.5 kB view details)

Uploaded Source

Built Distribution

django_email_queue-0.15.0-py2.py3-none-any.whl (14.8 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file django-email-queue-0.15.0.tar.gz.

File metadata

File hashes

Hashes for django-email-queue-0.15.0.tar.gz
Algorithm Hash digest
SHA256 bed038a85a917ede85b3fcca58e9aecf8ab834be3e19c0e632e26f7d3bdd4a1a
MD5 ff3222d4d2345c1defdf20ac5f2b025a
BLAKE2b-256 35ca6c10c8ea5fc6d4d9d9dea10f81a9ff78fda0f38f14e0f82d3cb2f024bb09

See more details on using hashes here.

Provenance

File details

Details for the file django_email_queue-0.15.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for django_email_queue-0.15.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 dece5f07eb6ea502d3d02c077ea5581fdf1f304bca9fc9d50166d758f9365da4
MD5 d62fd54ace55f0d013f4e8dead05ec5a
BLAKE2b-256 0646da879456f2eb9eb30e825a122ae0f67a815b4089e3ed573c78a0d2c2e294

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page