Skip to content

funkbit/django-celery-mailer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

django-celery-mailer

Django email backend that utilizes Celery for background execution. This is a fork of django-celery-email, with additional inspiration from django-mailer.

Installation

Install django-celery-mailer (available on PyPi):

pip install django-celery-mailer

Requires a Django Celery stack.

Usage

To enable django-celery-mailer for your project you need to add celery_mailer to INSTALLED_APPS:

INSTALLED_APPS += ('celery_mailer',)

You must then set it as your EMAIL_BACKEND:

EMAIL_BACKEND = 'celery_mailer.backends.CeleryEmailBackend'

As long as you're using the Django builtin SMTP email backend, you're set! All mail sent with Django's standard mechanisms will now be sent in the background with Celery.

Customization

By default django-celery-mailer will use Django's builtin SMTP email backend for the actual sending of the mail. If you'd like to use another backend, you may set it in CELERY_EMAIL_BACKEND just like you would normally have set EMAIL_BACKEND before you were using Celery. In fact, the normal installation procedure will most likely be to get your email working using only Django, then change EMAIL_BACKEND to CELERY_EMAIL_BACKEND, and then add the new EMAIL_BACKEND setting from above.

Available settings

NameDefaultDescription
USE_CELERYTrueUsed to disable running tasks in Celery
CELERY_EMAIL_BACKENDdjango.core.mail.backends.smtp.EmailBackendSee above
CELERY_EMAIL_TASK_CONFIG{'name': 'celery_mailer_send', 'ignore_result': True}Additional Celery Task configuration

Acknowledgements

About

A mix of django-mailer and django-celery-email. Work in progress.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages