Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: CMD-112 overwrite confirmation e-mail #448

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
3 changes: 2 additions & 1 deletion apps/tup-cms/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ COPY . /code/
RUN npx nx build tup-ui
RUN npx nx build tup-cms-react

FROM taccwma/core-cms:v4.9.0
# https://github.com/TACC/Core-CMS/pull/826
FROM taccwma/core-cms:7a9df738

WORKDIR /code

Expand Down
26 changes: 0 additions & 26 deletions apps/tup-cms/src/apps/portal/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from django.dispatch import receiver
from djangocms_forms.signals import form_submission
from django.conf import settings
from django.core.mail import send_mail


logger = logging.getLogger(f"portal.{__name__}")
Expand Down Expand Up @@ -43,35 +42,10 @@ def submit_ticket(form_data):
requests.post(f"{service_url}/tickets/noauth", data=ticket_data, files=[])


def send_confirmation_email(form_name, form_data):
email_body = """
<p>Greetings,</p>
<p>
You have successfully submitted a form on the TACC website. Thank you for your submission.
</p>
<p>
Business hours are Monday - Friday, 8AM to 5PM Central. We will respond to your submission
according to the information provided on the form webpage.
</p>
<p>
Sincerely,<br>
TACC Communications
</p>
"""
send_mail(
f"TACC Form Submission Received: {form_name}",
email_body,
"no-reply@tacc.utexas.edu",
[form_data["email"]],
html_message=email_body)


def callback(form, cleaned_data, **kwargs):
logger.debug(f"received submission from {form.name}")
if form.name == 'rt-ticket-form':
submit_ticket(cleaned_data)
elif ('email' in cleaned_data):
send_confirmation_email(form.name, cleaned_data)


class PortalConfig(AppConfig):
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<p>Greetings,</p>
<p>
You have successfully submitted a form on the TACC website. Thank you for your
submission.
</p>
<p>
Business hours are Monday - Friday, 8AM to 5PM Central. We will respond to
your submission according to the information provided on the form webpage.
</p>
<p>
Sincerely,<br />
TACC Communications
</p>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Greetings,

You have successfully submitted a form on the {site_name} website. Thank you for your submission.

Business hours are Monday - Friday, 8AM to 5PM Central. We will respond to your submission according to the information provided on the form webpage.

Sincerely,
{site_name} Communications
29 changes: 29 additions & 0 deletions apps/tup-cms/src/taccsite_cms/settings_custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,35 @@

TACC_SOCIAL_SHARE_PLATFORMS = ['linkedin', 'facebook', 'email']

########################
# TACC: EMAIL
########################

PORTAL_SHOULD_SEND_CONF_EMAIL = True
TEXT_CONFIRMATION_EMAIL = """
wesleyboar marked this conversation as resolved.
Show resolved Hide resolved
Greetings,

You have successfully submitted a form on the {site_name} website. Thank you for your submission.

Business hours are Monday - Friday, 8AM to 5PM Central. We will respond to your submission according to the information provided on the form webpage.

Sincerely,
{site_name} Communications
"""
HTML_CONFIRMATION_EMAIL = """
wesleyboar marked this conversation as resolved.
Show resolved Hide resolved
<p>Greetings,</p>
<p>
You have successfully submitted a form on the {site_name} website. Thank you for your submission.
</p>
<p>
Business hours are Monday - Friday, 8AM to 5PM Central. We will respond to your submission according to the information provided on the form webpage.
</p>
<p>
Sincerely,<br />
{site_name} Communications
</p>
"""

########################
# DJANGOCMS_BLOG
########################
Expand Down