Metadata-Version: 2.1
Name: django-dramatiq-email
Version: 1.4.2
Summary: A Django email backend using Dramatiq to send emails using background workers
Home-page: https://gitlab.com/sendcloud-public/django-dramatiq-email
License: MIT
Author: Tim Drijvers
Author-email: tim@sendcloud.com
Requires-Python: >=3.7,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Dist: django (<5.0)
Requires-Dist: django_dramatiq (>0.9,<1.0)
Requires-Dist: dramatiq (>=1.13.0,<2.0.0)
Project-URL: Repository, https://gitlab.com/sendcloud-public/django-dramatiq-email
Description-Content-Type: text/markdown

# Django Dramatiq Email

Email backend for Django sending emails via Dramatiq.

This package is tested up to Django 4.2.

[![Pipeline Status](https://gitlab.com/sendcloud-public/django-dramatiq-email/badges/master/pipeline.svg)](https://gitlab.com/sendcloud-public/django-dramatiq-email/-/pipelines)
[![Code coverage Status](https://gitlab.com/sendcloud-public/django-dramatiq-email/badges/master/coverage.svg)](https://gitlab.com/sendcloud-public/django-dramatiq-email/-/pipelines)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://pypi.org/project/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](https://dramatiq.io/reference.html#dramatiq.actor), [user guide](https://dramatiq.io/guide.html)) for `send_email` can be set via the `DRAMATIQ_EMAIL_TASK_CONFIG` dict in your `settings.py`.

The default args are [here](django_dramatiq_email/tasks.py) - most notably, the default `queue_name` is `django_email`.

Example configuration (using the Retry middleware):

```python
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](https://gitlab.com/timdrijvers)

