Django email backend using Huey
Project description
A simple Django email backend which uses Huey.
Usage
Add the app to your settings:
# settings.py
INSTALLED_APPS = [
...
"huey.contrib.djhuey",
"hueymail",
...
]
and use it as your email backend:
# settings.py
EMAIL_BACKEND = 'hueymail.backends.EmailBackend'
Last, choose which email backend Huey should dispatch to via the HUEY_EMAIL_BACKEND setting:
# settings.py
HUEY_EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend"
How it works
What happens when you send an email? Basically this:
Django creates a new instance of hueymail.backends.EmailBackend, and calls its send_messages() method with the email messages it wants to send.
The send_messages() method of the hueymail.backends.EmailBackend instance dispatches a Huey task called dispatch_messages(), which is responsible for sending those messages.
The dispatch_messages() task creates an instance of HUEY_EMAIL_BACKEND and calls its send_messages() method with the original email messages.
License
Copyright (c) 2022 Christopher McDonald
Distributed under the terms of the MIT license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file django-huey-email-backend-0.1.1.tar.gz
.
File metadata
- Download URL: django-huey-email-backend-0.1.1.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9bb07e05d9526132247083b3ec6b778533181f80cc3be5d1386b741b700c4f3f |
|
MD5 | b6f673fbb5d6f510342f65fadfb93fb9 |
|
BLAKE2b-256 | 65eb1846dee5621a45ff09134e5e7e2c24c3d11c76e8ac1b7841dfd18322d80c |
File details
Details for the file django_huey_email_backend-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: django_huey_email_backend-0.1.1-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2e40317a6ac0fdfb3e42bbecaaf37c6c1e6c002cbd91e9912ee64119cc9b778f |
|
MD5 | 79f4c8f0857984fc515e10bbcba67436 |
|
BLAKE2b-256 | f3a18e921ececdfa2405f5e89b9128cadd80b18bdfa390cdb37dd2a53a86a8aa |