From 8e72cfc4854ae28643bf04e0201aa52babe7a325 Mon Sep 17 00:00:00 2001 From: duckduckgrayduck <102841251+duckduckgrayduck@users.noreply.github.com> Date: Mon, 10 Aug 2026 09:48:34 -0500 Subject: [PATCH 1/2] Try to preserve anymail attr when they reach Celery email backend --- config/settings/production.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/config/settings/production.py b/config/settings/production.py index 82c99e8b..5d71a2bd 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 = ["esp_extra", "envelope_sender"] + # https://anymail.readthedocs.io/en/stable/installation/#anymail-settings-reference ANYMAIL = { "MAILGUN_API_KEY": env("MAILGUN_API_KEY"), From 27afa882b9720a96ae0fe30803ccdfb4073be33a Mon Sep 17 00:00:00 2001 From: duckduckgrayduck <102841251+duckduckgrayduck@users.noreply.github.com> Date: Mon, 10 Aug 2026 10:01:23 -0500 Subject: [PATCH 2/2] Now try only envelope_sender --- config/settings/production.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/settings/production.py b/config/settings/production.py index 5d71a2bd..cada5e59 100644 --- a/config/settings/production.py +++ b/config/settings/production.py @@ -136,7 +136,7 @@ class StaticRootS3Boto3Storage(S3Boto3Storage): 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 = ["esp_extra", "envelope_sender"] +CELERY_EMAIL_MESSAGE_EXTRA_ATTRIBUTES = ["envelope_sender"] # https://anymail.readthedocs.io/en/stable/installation/#anymail-settings-reference ANYMAIL = {