Python/Django: sending emails in the background

nemesisdesign picture nemesisdesign · Oct 2, 2011 · Viewed 12.1k times · Source

Imagine a situation in which a user performs an action on a website and admins are notified. Imagine there are 20 admins to notify. By using normal methods for sending emails with Django the user will have to wait until all the emails are sent before being able to proceed.

How can I send all the emails in a separate process so the user doesn't have to wait? Is it possible?

Answer

andreaspelme picture andreaspelme · Oct 2, 2011

Use celery as a task queue and django-celery-email which is an Django e-mail backend that dispatches e-mail sending to a celery task.