-
Notifications
You must be signed in to change notification settings - Fork 917
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch email sending to task queue when available (#15270)
This will mean that CMS notifications will go via the task queue. The default queue of, well, "default" will be used, which is one of the queues already being processed by our worker pods: https://github.com/mozilla/bedrock/blob/main/bin/run-worker.sh#L8 At the moment, the Web deployment does not have Redis available to it so will not have a task queue enabled, and so in turn the emails that web pods send (eg press requests) will have no change to their sending pattern
- Loading branch information
1 parent
572c25e
commit e1e9693
Showing
4 changed files
with
28 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -791,6 +791,7 @@ def get_app_name(hostname): | |
"django_extensions", | ||
"lib.l10n_utils", | ||
"django_rq", | ||
"django_rq_email_backend", | ||
"mozilla_django_oidc", # needs to be loaded after django.contrib.auth | ||
] | ||
|
||
|
@@ -952,8 +953,11 @@ def _is_bedrock_custom_app(app_name): | |
# This can be changed to use session once we do add a database. | ||
MESSAGE_STORAGE = "django.contrib.messages.storage.cookie.CookieStorage" | ||
|
||
|
||
default_email_backend = "django.core.mail.backends.console.EmailBackend" if DEBUG else "django.core.mail.backends.smtp.EmailBackend" | ||
default_email_backend = "django.core.mail.backends.smtp.EmailBackend" | ||
if DEBUG: | ||
default_email_backend = "django.core.mail.backends.console.EmailBackend" | ||
elif TASK_QUEUE_AVAILABLE is True: | ||
default_email_backend = "django_rq_email_backend.backends.RQEmailBackend" | ||
|
||
DEFAULT_FROM_EMAIL = "Mozilla.com <[email protected]>" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters