Skip to main content

A Django email backend using Dramatiq to send emails using background workers

Project description

Django Dramatiq Email

Email backend for Django sending emails via Dramatiq.

This package is tested up to Django 4.2.

Test Status Lint Status Code coverage Status Code style: black

Installation

To enable django-dramatiq-email, modify your project settings.py:

  • Add "django_dramatiq_email" to INSTALLED_APPS below "django_dramatiq",
  • Set EMAIL_BACKEND to "django_dramatiq_email.backends.DramatiqEmailBackend",
  • Set DRAMATIQ_EMAIL_BACKEND to the actual email backend you want to use (SMTP, Anymail, etc),
  • Optionally, add the DRAMATIQ_EMAIL_TASK_CONFIG dict as shown below.

Configuration

The dramatiq.actor args (reference, user guide) for send_email can be set via the DRAMATIQ_EMAIL_TASK_CONFIG dict in your settings.py.

The default args are here - most notably, the default queue_name is django_email.

Example configuration (using the Retry middleware):

DRAMATIQ_EMAIL_TASK_CONFIG = {
    "max_retries": 20,
    "min_backoff": 15000,
    "max_backoff": 86400000,
    "queue_name": "my_custom_queue"
}

Bulk emails

Bulk emails are send using individual Dramatiq tasks. Doing so these tasks can be restarted individually.

Maintainer

Tim Drijvers

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_dramatiq_email-1.4.1.tar.gz (4.1 kB view hashes)

Uploaded Source

Built Distribution

django_dramatiq_email-1.4.1-py3-none-any.whl (5.2 kB view hashes)

Uploaded Python 3

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