Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to integrate it with Amazon SES #74

Open
prafulbagai708 opened this issue May 24, 2020 · 4 comments
Open

How to integrate it with Amazon SES #74

prafulbagai708 opened this issue May 24, 2020 · 4 comments

Comments

@prafulbagai708
Copy link

prafulbagai708 commented May 24, 2020

The question is self-explanatory! I've integrated django-celery-email. Now I want to send an email using Amazon SES, to be specific using https://github.com/django-ses/django-ses/ . How can I do that?

@sandhuharjodh
Copy link

Any updates on it?

@jd-solanki
Copy link

+1

@arnav13081994
Copy link

arnav13081994 commented Jul 22, 2020

You need to add the following to settings.py


# https://anymail.readthedocs.io/en/stable/installation/#installing-anymail
INSTALLED_APPS += ["anymail"]  # noqa F405
# https://docs.djangoproject.com/en/dev/ref/settings/#email-backend
# EMAIL_BACKEND = "anymail.backends.amazon_ses.EmailBackend"
# Use Celery for sending emails
EMAIL_BACKEND = "djcelery_email.backends.CeleryEmailBackend"
# https://github.com/pmclanahan/django-celery-email
INSTALLED_APPS += ["djcelery_email"]  # noqa F405
# Make celery delegate the actual email sending to AWS SES
CELERY_EMAIL_BACKEND = "anymail.backends.amazon_ses.EmailBackend"


Please note that EMAIL_BACKEND was changed from anymail.backends.amazon_ses.EmailBackend to djcelery_email.backends.CeleryEmailBackend. This makes Django use celery workers for all email tasks. To make sure the actual email sending task is handled by anymail.backends.amazon_ses.EmailBackend (SES) change the CELERY_EMAIL_BACKEND to anymail.backends.amazon_ses.EmailBackend

@prafulbagai
Copy link

You don't need to use anymail for this. Just set the following:-

EMAIL_BACKEND = 'djcelery_email.backends.CeleryEmailBackend'
CELERY_EMAIL_BACKEND = 'django_ses.SESBackend'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants