Explore Courses Blog Tutorials Interview Questions
0 votes
in Web Technology by (19.9k points)

I am using django-anymail(sendgrid) to send emails in my web app. I would like to let the emails send in asynchronous manner without letting the users wait for some time.So, how can I configure django-celery-email with django-anymail.

Now, my email config. is:




EMAIL_BACKEND = "anymail.backends.sendgrid.EmailBackend"

1 Answer

0 votes
by (25.1k points)

In your

EMAIL_BACKEND = "djcelery_email.backends.CeleryEmailBackend"

CELERY_EMAIL_BACKEND = "anymail.backends.sendgrid.EmailBackend"  # your setting from before

Also, note that django-celery-email doesn't know about Anymail's extra sending options, like metadata, tags, template_id, envelope_sender, etc. If you use any of those, you'll need to let django-celery-email know about them in your settings:

CELERY_EMAIL_MESSAGE_EXTRA_ATTRIBUTES = ['metadata', 'tags']  # or whatever you use

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Browse Categories