SES issue: Comment out email sending logic in contact form submission
This commit is contained in:
parent
42bfb8a806
commit
35362b48c1
@ -115,46 +115,46 @@ def contact_form_submit(request):
|
|||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
logger.warning("contact form admin notification email failed: %s", exc)
|
logger.warning("contact form admin notification email failed: %s", exc)
|
||||||
|
|
||||||
if submission.email:
|
# if submission.email:
|
||||||
values_text = {
|
# values_text = {
|
||||||
"name": submission.name,
|
# "name": submission.name,
|
||||||
"email": submission.email,
|
# "email": submission.email,
|
||||||
"contact": submission.contact,
|
# "contact": submission.contact,
|
||||||
"category": submission.get_category_display(),
|
# "category": submission.get_category_display(),
|
||||||
"message": submission.message,
|
# "message": submission.message,
|
||||||
"source_page": submission.source_page or "",
|
# "source_page": submission.source_page or "",
|
||||||
}
|
# }
|
||||||
values_html = {
|
# values_html = {
|
||||||
"name": escape(submission.name),
|
# "name": escape(submission.name),
|
||||||
"email": escape(submission.email),
|
# "email": escape(submission.email),
|
||||||
"contact": escape(submission.contact),
|
# "contact": escape(submission.contact),
|
||||||
"category": escape(submission.get_category_display()),
|
# "category": escape(submission.get_category_display()),
|
||||||
"message": escape(submission.message).replace("\n", "<br>"),
|
# "message": escape(submission.message).replace("\n", "<br>"),
|
||||||
"source_page": escape(submission.source_page or ""),
|
# "source_page": escape(submission.source_page or ""),
|
||||||
}
|
# }
|
||||||
user_subject = _render_contact_template(
|
# user_subject = _render_contact_template(
|
||||||
notification_settings.contact_form_user_subject_template,
|
# notification_settings.contact_form_user_subject_template,
|
||||||
values_text,
|
# values_text,
|
||||||
)
|
# )
|
||||||
user_text = _render_contact_template(
|
# user_text = _render_contact_template(
|
||||||
notification_settings.contact_form_user_text_template,
|
# notification_settings.contact_form_user_text_template,
|
||||||
values_text,
|
# values_text,
|
||||||
)
|
# )
|
||||||
user_html = _render_contact_template(
|
# user_html = _render_contact_template(
|
||||||
notification_settings.contact_form_user_html_template,
|
# notification_settings.contact_form_user_html_template,
|
||||||
values_html,
|
# values_html,
|
||||||
)
|
# )
|
||||||
try:
|
# try:
|
||||||
send_contact_user_email(
|
# send_contact_user_email(
|
||||||
to_email=submission.email,
|
# to_email=submission.email,
|
||||||
subject=user_subject,
|
# subject=user_subject,
|
||||||
text_body=user_text,
|
# text_body=user_text,
|
||||||
html_body=user_html,
|
# html_body=user_html,
|
||||||
notification_config=notification_settings,
|
# notification_config=notification_settings,
|
||||||
smtp_config=smtp_settings,
|
# smtp_config=smtp_settings,
|
||||||
)
|
# )
|
||||||
except Exception as exc:
|
# except Exception as exc:
|
||||||
logger.warning("contact form user copy email failed: %s", exc)
|
# logger.warning("contact form user copy email failed: %s", exc)
|
||||||
|
|
||||||
if request.headers.get("x-requested-with") == "XMLHttpRequest":
|
if request.headers.get("x-requested-with") == "XMLHttpRequest":
|
||||||
return JsonResponse({"success": True})
|
return JsonResponse({"success": True})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user