Skip to main content

Django Mailer

https://github.com/pinax/django-mailer/actions/workflows/build.yml/badge.svg https://img.shields.io/coveralls/pinax/django-mailer.svg https://img.shields.io/pypi/dm/django-mailer.svg https://img.shields.io/pypi/v/django-mailer.svg https://img.shields.io/badge/license-MIT-blue.svg

django-mailer

django-mailer is a reusable Django app for queuing the sending of email. It works by storing email in the database for later sending. This has a number of advantages:

  • robustness - if your email provider goes down or has a temporary error, the email won’t be lost. In addition, since the send_mail() call always succeeds (unless your database is out of action), then the HTTP request that triggered the email to be sent won’t crash, and any ongoing transaction won’t be rolled back.

  • correctness - when an outgoing email is created as part of a transaction, since it is stored in the database it will participate in transactions. This means it won’t be sent until the transaction is committed, and won’t be sent at all if the transaction is rolled back.

In addition, if you want to ensure that mails are sent very quickly, and without heaving polling, django-mailer comes with a PostgreSQL specific runmailer_pg command. This uses PostgreSQL’s NOTIFY/LISTEN feature to be able to send emails as soon as they are added to the queue.

Limitations

File attachments are also temporarily stored in the database, which means if you are sending files larger than several hundred KB in size, you are likely to run into database limitations on how large your query can be. If this happens, you’ll either need to fall back to using Django’s default mail backend, or increase your database limits (a procedure that depends on which database you are using).

With django-mailer, you can’t know in a Django view function whether the email has actually been sent or not - the send_mail function just stores mail on the queue to be sent later.

django-mailer was developed as part of the Pinax ecosystem but is just a Django app and can be used independently of other Pinax apps.

Requirements

  • Django >= 2.2

  • Databases: django-mailer supports all databases that Django supports, with the following notes:

    • SQLite: you may experience ‘database is locked’ errors if the send_mail command runs when anything else is attempting to put items on the queue. For this reason SQLite is not recommended for use with django-mailer.

    • MySQL: the developers don’t test against MySQL.

Usage

See usage.rst in the docs.

Support

The Pinax documentation is available at http://pinaxproject.com/pinax/.

This is an Open Source project maintained by volunteers, and outside this documentation the maintainers do not offer other support. For cases where you have found a bug you can file a GitHub issue. In case of any questions we recommend you join the Pinax Slack team and ping the Pinax team there instead of creating an issue on GitHub. You may also be able to get help on other programming sites like Stack Overflow.

Contribute

See CONTRIBUTING.rst for information about contributing patches to django-mailer.

See this blog post including a video, or our How to Contribute section for an overview on how contributing to Pinax works. For concrete contribution ideas, please see our Ways to Contribute/What We Need Help With section.

We also highly recommend reading our Open Source and Self-Care blog post.

Code of Conduct

In order to foster a kind, inclusive, and harassment-free community, the Pinax Project has a code of conduct. We ask you to treat everyone as a smart human programmer that shares an interest in Python, Django, and Pinax with you.

Pinax Project Blog and Twitter

For updates and news regarding the Pinax Project, please follow us on Twitter at @pinaxproject and check out our blog.

Metadata

Release files for django-mailer 2.3.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-mailer 2.3.2
File Size Uploaded
django-mailer-2.3.2.tar.gz 36.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-mailer 2.3.2
File Interpreter ABI Platform
django_mailer-2.3.2-py3-none-any.whl Python 3 none any Details

Total release size: 62.1 kB

Release files / django-mailer-2.3.2.tar.gz

Download URL django-mailer-2.3.2.tar.gz
Size 36.3 kB
Tags Source
SHA-256 checksum
How to use checksums
6ea0cbec09f57eb91376780a5f20ab7a834b942435a575e92e8e021f7838d78f
BLAKE2b-256 checksum
How to use checksums
833647e879aa64502624278dec22dae04505c3463126529bd944628c17f7a849
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.12

Release files / django_mailer-2.3.2-py3-none-any.whl

Download URL django_mailer-2.3.2-py3-none-any.whl
Size 25.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c7ef5ad63d5484246908bd1ce583c22837c66c1a7b593c9b816f4ead2421c995
BLAKE2b-256 checksum
How to use checksums
6fdf65d30943246e2895f084075ab35811571e1bfe6933c8ab8d2eb4a9c4869c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.12

Release history Release notifications | RSS feed

This release

2.3.2 This release

2 release files

2.3.1

2 release files

2.3

2 release files

2.2.1

2 release files

2.2

2 release files

2.1

2 release files

2.0.1

2 release files

2.0

2 release files

1.2.6

2 release files

1.2.5

2 release files

1.2.4

2 release files

1.2.3

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2

2 release files

1.1

2 release files

1.0.1

2 release files

1.0

2 release files

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page