diff --git a/config/settings/production.py b/config/settings/production.py index 82c99e8b..cada5e59 100644 --- a/config/settings/production.py +++ b/config/settings/production.py @@ -135,6 +135,9 @@ class StaticRootS3Boto3Storage(S3Boto3Storage): INSTALLED_APPS += ["anymail", "djcelery_email"] # noqa F405 CELERY_EMAIL_BACKEND = "anymail.backends.mailgun.EmailBackend" EMAIL_BACKEND = "djcelery_email.backends.CeleryEmailBackend" +# Preserve Anymail attributes when it gets to Celery +CELERY_EMAIL_MESSAGE_EXTRA_ATTRIBUTES = ["envelope_sender"] + # https://anymail.readthedocs.io/en/stable/installation/#anymail-settings-reference ANYMAIL = { "MAILGUN_API_KEY": env("MAILGUN_API_KEY"),