Package: django-celery-email
ADjangoemail backend that uses aCeleryqueue for out-of-band sending
of the messages.WarningThis version requires the following versions:Python >= 3.5Django 2.2, and 3.0Celery 4.0Using django-celery-emailTo enabledjango-celery-emailfor your project you need to adddjcelery_emailtoINSTALLED_APPS:INSTALLED_APPS += ("djcelery_email",)You must then setdjango-celery-emailas yourEMAIL_BACKEND:EMAIL_BACKEND = 'djcelery_email.backends.CeleryEmailBackend'By defaultdjango-celery-emailwill use Django’s builtinSMTPemail backend
for the actual sending of the mail. If you’d like to use another backend, you
may set it inCELERY_EMAIL_BACKENDjust like you would normally have setEMAIL_BACKENDbefore you were using Celery. In fact, the normal installation
procedure will most likely be to get your email working using only Django, then
changeEMAIL_BACKENDtoCELERY_EMAIL_BACKEND, and then add the newEMAIL_BACKENDsetting from above.Mass email are sent in chunks of sizeCELERY_EMAIL_CHUNK_SIZE(defaults to 10).If you need to set any of the settings (attributes) you’d normally be able to set on aCelery Taskclass had you written it yourself, you may specify them in adictin theCELERY_EMAIL_TASK_CONFIGsetting:CELERY_EMAIL_TASK_CONFIG = {
    'queue' : 'email',
    'rate_limit' : '50/m',  # * CELERY_EMAIL_CHUNK_SIZE (default: 10)
    ...
}There are some default settings. Unless you specify otherwise, the equivalent of the
following settings will apply:CELERY_EMAIL_TASK_CONFIG = {
    'name': 'djcelery_email_send',
    'ignore_result': True,
}After this setup is complete, and you have a working Celery install, sending
email will work exactly like it did before, except that the sending will be
handled by your Celery workers:from django.core import mail

emails = (
    ('Hey Man', "I'm The Dude! So that's what you call me.", 'dude@aol.com', ['mr@lebowski.com']),
    ('Dammit Walter', "Let's go bowlin'.", 'dude@aol.com', ['wsobchak@vfw.org']),
)
results = mail.send_mass_mail(emails)resultswill be a list of celeryAsyncResultobjects that you may ignore, or use to check the
status of the email delivery task, or even wait for it to complete if want. You have to enable a result
backend and setignore_resulttoFalseinCELERY_EMAIL_TASK_CONFIGif you want to use these.
You should also setCELERY_EMAIL_CHUNK_SIZE = 1in settings if you are concerned about task status
and results.See theCelery docsfor more info.len(results)will be the number of emails you attempted to send divided by CELERY_EMAIL_CHUNK_SIZE, and is in no way a reflection on the success or failure
of their delivery.Changelog3.0.0 - 2019.12.10Support for Django 3.0Support for Python 3.8Droppped support for Django 1.x, Django 2.0 and Django 2.1Droppped support for Python 2.72.0.2 - 2019.05.29Reduce memory usage by running email_to_dict on chunks. ThanksPaul Brown.Simplify dict_to_email for readability and efficiency. ThanksPaul Brown.Update test matrix for supported versions of Django, Celery and Python. ThanksJames.2.0.1 - 2018.18.27Fix bug preventing sending text/* encoded mime attachments. ThanksCesar Canassa.2.0 - 2017.07.10Support for Django 1.11 and Celery 4.0Dropped support for Celery 2.x and 3.xDropped support for Python 3.31.1.5 - 2016.07.20Support extra email attributes via CELERY_EMAIL_MESSAGE_EXTRA_ATTRIBUTES settingUpdated version requirements in README1.1.4 - 2016.01.19Support sending email with embedded images. ThanksGeorg Zimmer.Document CELERY_EMAIL_CHUNK_SIZE. ThanksJonas Haag.Add exception handling to email backend connection. ThanksTom.1.1.3 - 2015.11.06Support setting celery.base from string. ThanksMatthew Jacobi.Use six for py2/3 string compatibility. ThanksMatthew Jacobi.Pass content_subtype back in for retries. ThanksMark Joshua Tan.Rework how tests work, add tox, rework travis-ci matrix.Use six from django.utils.Release a universal wheel.1.1.2 - 2015.07.06Fix for HTML-only emails. Thanksgnarvaja.1.1.1 - 2015.03.20Fix for backward compatibility of task kwarg handling - ThanksJeremy Thurgood.1.1.0 - 2015.03.06New PyPI release rolling up 1.0.5 changes and some cleanup.More backward compatability in task. Will still accept message objects and lists of message objects.Thanks again to everyone who contributed to 1.0.5.1.0.5 - 2014.08.24Django 1.6 support, Travis CI testing, chunked sending & more - thanksJonas Haag.HTML email support - thanksAndres Riancho.Support for JSON transit for Celery, sponsored byDigiACTive.Drop support for Django 1.2.1.0.4 - 2013.10.12Add Django 1.5.2 and Python 3 support.Thanks toStefan Wehrmeyerfor the contribution.1.0.3 - 2012.03.06Backend will now pass any kwargs with which it is initialized to the
email sending backend.Thanks toFedor Tyurinfor the contribution.1.0.2 - 2012.02.21Task and backend now accept kwargs that can be used in signal handlers.Task now returns the result from the email sending backend.Thanks toYehonatan Danivfor these changes.1.0.1 - 2011.10.06Fixed a bug that resulted in tasks that were throwing errors reporting success.If there is an exception thrown by the sending email backend, the result of the task will
now be this exception.