-
Notifications
You must be signed in to change notification settings - Fork 0
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 custom confirmation e-mail via setting #448
Draft
wesleyboar
wants to merge
16
commits into
main
Choose a base branch
from
test/CMD-112-override-confirmation-email
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
6477843
test: CMD-112 overwrite confirmation e-mail
wesleyboar 17d00ad
chore: npx nx format:write
wesleyboar 38275b6
test: cmd-112 verbose way to get core email_… app
wesleyboar 32c4cff
fix: cmd-112 it works now (plan A)
wesleyboar 3d9d282
refactor: cmd-112 no need to change docker-compose
wesleyboar 9c7007f
refactor: cmd-112
wesleyboar f13eaf7
chore: cmd-112 via core-cms v4.10.1
wesleyboar 4bb980f
chore: cmd-112 remove outdated files
wesleyboar c48bfce
Merge branch 'main' into test/CMD-112-override-confirmation-email
wesleyboar e780f44
Merge branch 'main' into test/CMD-112-override-confirmation-email
wesleyboar 0807751
fix: update settings_custom.py with latest e-mail
wesleyboar 3fb8559
fix: use mailto link for email
wesleyboar ecff05e
fix: use mailto link for all emails
wesleyboar c66927f
fix: update text-format e-mail
wesleyboar c54aa75
test(tup-cms): `form_name` support from CMS
wesleyboar fbf6ee9
feat(tup-cms): `form_name` via v4.10.2-extra.1
wesleyboar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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 |
---|---|---|
|
@@ -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__}") | ||
|
@@ -43,38 +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 = f""" | ||
<p>Greetings,</p> | ||
<p> | ||
Thank you for reaching out to TACC and completing the {form_name}. | ||
</p> | ||
<p> | ||
<ul> | ||
<li>For training registration requests, you will be contacted within one week to confirm registration. For additional help please contact Lauren Bruce ([email protected]).</li> | ||
<li>For tour requests, a tour coordinator will contact you within two business days to complete your reservation. For additional assistance please reach out to [email protected].</li> | ||
<li>For all other issues, a TACC support person will be in contact shortly. For additional assistance please reach out to [email protected].</li> | ||
</ul> | ||
</p> | ||
<p> | ||
Thank you for your time,<br> | ||
TACC Support | ||
</p> | ||
""" | ||
send_mail( | ||
f"TACC Form Submission Received: {form_name}", | ||
email_body, | ||
"[email protected]", | ||
[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): | ||
|
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 |
---|---|---|
|
@@ -150,6 +150,41 @@ | |
|
||
TACC_SOCIAL_SHARE_PLATFORMS = ['linkedin', 'facebook', 'email'] | ||
|
||
######################## | ||
# TACC: EMAIL | ||
######################## | ||
|
||
PORTAL_SHOULD_SEND_CONF_EMAIL = True | ||
PORTAL_CONF_EMAIL_TEXT = """ | ||
Greetings, | ||
|
||
Thank you for reaching out to TACC and completing the {form_name}. | ||
|
||
- For training registration requests, you will be contacted within one week to confirm registration. For additional help please contact Lauren Bruce ([email protected]). | ||
- For tour requests, a tour coordinator will contact you within two business days to complete your reservation. For additional assistance please reach out to [email protected]. | ||
- For all other issues, a TACC support person will be in contact shortly. For additional assistance please reach out to [email protected]. | ||
|
||
Thank you for your time, | ||
TACC Support | ||
""" | ||
PORTAL_CONF_EMAIL_HTML = """ | ||
<p>Greetings,</p> | ||
<p> | ||
Thank you for reaching out to TACC and completing the {form_name}. | ||
</p> | ||
<p> | ||
<ul> | ||
<li>For training registration requests, you will be contacted within one week to confirm registration. For additional help please contact Lauren Bruce (<a href="mailto:[email protected]">[email protected]</a>).</li> | ||
<li>For tour requests, a tour coordinator will contact you within two business days to complete your reservation. For additional assistance please reach out to <a href="mailto:[email protected]">[email protected]</a>.</li> | ||
<li>For all other issues, a TACC support person will be in contact shortly. For additional assistance please reach out to <a href="mailto:[email protected]">[email protected]</a>.</li> | ||
</ul> | ||
</p> | ||
<p> | ||
Thank you for your time,<br> | ||
TACC Support | ||
</p> | ||
""" | ||
|
||
######################## | ||
# DJANGOCMS_BLOG | ||
######################## | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Caution
REGRESSION BUG: Yes, Core-CMS will
send_confirmation_email
instead. But TACC should notsend_confirmation_email
if ticket is anrt-ticket-form
. Core-CMS does not know this, so TACC willsend_confirmation_email
forrt-ticket-form
.