diff --git a/apps/email_management/apps.py b/apps/email_management/apps.py index ffb9660f7..9029137ee 100644 --- a/apps/email_management/apps.py +++ b/apps/email_management/apps.py @@ -2,6 +2,9 @@ import logging from djangocms_forms.signals import form_submission from django.core.mail import send_mail +from django.conf import settings + +PORTAL_SHOULD_SEND_CONF_EMAIL = settings.PORTAL_SHOULD_SEND_CONF_EMAIL logger = logging.getLogger(f"portal.{__name__}") @@ -44,7 +47,7 @@ def send_confirmation_email(form_name, form_data): def callback(form, cleaned_data, **kwargs): logger.debug(f"received submission from {form.name}") logger.debug(type(cleaned_data)) - if ('email' in cleaned_data): + if ('email' in cleaned_data and PORTAL_SHOULD_SEND_CONF_EMAIL): send_confirmation_email(form.name, cleaned_data) class EmailManagementConfig(AppConfig): diff --git a/taccsite_cms/_settings/email.py b/taccsite_cms/_settings/email.py index 70ecc6425..5ef4fb3f0 100644 --- a/taccsite_cms/_settings/email.py +++ b/taccsite_cms/_settings/email.py @@ -23,3 +23,9 @@ # EMAIL_HOST = 'localhost' # EMAIL_PORT = 1025 # DEFAULT_FROM_EMAIL = 'no-reply@localhost' + +######################## +# TACC: EMAIL +######################## + +PORTAL_SHOULD_SEND_CONF_EMAIL = False