mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-10 21:23:32 +02:00
Add migration and documentation
This commit is contained in:
parent
6ad2546a40
commit
cbf1a24b4e
3 changed files with 47 additions and 1 deletions
|
@ -9,6 +9,7 @@ from email.mime.application import MIMEApplication
|
|||
from email.mime.multipart import MIMEMultipart
|
||||
from email.mime.text import MIMEText
|
||||
from waffle import switch_is_active
|
||||
from django.conf import settings
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
@ -34,7 +35,7 @@ def send_templated_email(
|
|||
context as Django's HTML templates. context gives additional information
|
||||
that the template may use.
|
||||
"""
|
||||
if switch_is_active("disable_email_sending"):
|
||||
if switch_is_active("disable_email_sending") and not settings.IS_PRODUCTION:
|
||||
raise EmailSendingError("Could not send email. Email sending is disabled due to switch 'disable_email_sending'.")
|
||||
|
||||
logger.info(f"An email was sent! Template name: {template_name} to {to_address}")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue