Django DB Email Backend
Record Email Messages Sent to database , with the ability to also send them via SMTP.
Usage
Install
pip install kn-django-db-email-backend
In settings.py:
INSTALLED_APPS += ['db_email_backend'] EMAIL_BACKEND = 'db_email_backend.backend.DBEmailBackend' # record the email message to database # OR EMAIL_BACKEND = 'db_email_backend.backend.SMTPDBEmailBackend' # Record to database and send via SMTP. # IF errors happened you can see it in the Admin and resend it again.
Migrate:
$ python manage.py migrate
Configuration
SMTP_EMAIL_FILTER_FUNCTION_PATH default to db_email_backend.utils.smtp_filter_email_function. a dotted path to the smtp email filter function. A filter function for the smtp email, takes the email_message (django.core.mail.message.EmailMessage) as a parameter, and return False if this message should be filter out out and not sent via the backend.
Example:
def only_allow_emails_to_mahad(message):
return True if 'mahad@kuwaitnet.com' in message.to else False
DB_EMAIL_FILTER_FUNCTION_PATH default to db_email_backend.utils.db_filter_email_function. a dotted path to the db email filter function. same as the SMTP one but for the Database.
Example:
def dont_record_error_emails(message):
return False if settings.EMAIL_SUBJECT_PREFIX in message.subject else True
Admin
Package have and admin integration ready where you can send the email SMTP even if the EMAIL_HOST = “db_email_backend.backend.DBEmailBackend”
Metadata
Release files for kn-django-db-email-backend 0.5.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| kn-django-db-email-backend-0.5.9.tar.gz | 8.3 kB | Without provenance | Details |
Release files / kn-django-db-email-backend-0.5.9.tar.gz
| Download URL | kn-django-db-email-backend-0.5.9.tar.gz |
|---|---|
| Size | 8.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1d3a6fceb5219549df6f26f5a45b3a5734c2c702ca2bad3a91e210b285913f8d
|
|
BLAKE2b-256 checksum How to use checksums |
fcec8669243312d5f2611b15fe1b2150f0ae0b15f11e2c5497bf519ac726ddbb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.8.16
|
Security for kn-django-db-email-backend 0.5.9
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.