Skip to content

Commit

Permalink
Change email templates (#735)
Browse files Browse the repository at this point in the history
* Change email templates

* Improve reply emails code

* Change call to action

* Standardize email subjects
  • Loading branch information
aviupadhyayula authored Oct 11, 2024
1 parent de6e368 commit 9486f1b
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 28 deletions.
5 changes: 2 additions & 3 deletions backend/clubs/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -677,17 +677,16 @@ def send_approval_email(self, request=None, change=False):
"view_url": settings.VIEW_URL.format(domain=domain, club=self.code),
"edit_url": settings.EDIT_URL.format(domain=domain, club=self.code),
"change": change,
"reply_emails": settings.OSA_EMAILS + [settings.BRANDING_SITE_EMAIL],
}

emails = self.get_officer_emails()

if emails:
send_mail_helper(
name="approval_status",
subject="{}{} {} on {}".format(
"Changes to " if change else "",
subject="{} status update on {}".format(
self.name,
"accepted" if self.approved else "not approved",
settings.BRANDING_SITE_NAME,
),
emails=emails,
Expand Down
6 changes: 3 additions & 3 deletions backend/clubs/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2068,17 +2068,17 @@ def perform_destroy(self, instance):
# Send notice to club officers and executor
context = {
"name": club.name,
"branding_site_name": settings.BRANDING_SITE_NAME,
"branding_site_email": settings.BRANDING_SITE_EMAIL,
"reply_emails": settings.OSA_EMAILS + [settings.BRANDING_SITE_EMAIL],
}
emails = club.get_officer_emails() + [self.request.user.email]
send_mail_helper(
name="club_deletion",
subject="Removal of {} from {}".format(
subject="{} status update on {}".format(
club.name, settings.BRANDING_SITE_NAME
),
emails=emails,
context=context,
reply_to=settings.OSA_EMAILS + [settings.BRANDING_SITE_EMAIL],
)

@action(detail=False, methods=["GET"])
Expand Down
32 changes: 19 additions & 13 deletions backend/templates/emails/approval_status.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,37 +13,43 @@
type: string
year:
type: number
reply_emails:
type: array
items:
type: string
-->
{% extends 'emails/base.html' %}

{% block content %}
<h2><b>{{ name }}</b> {% if change %}changes{% else %}renewal{% endif %} marked as {% if approved %}approved{% else %}not approved{% endif %} on Penn Clubs</h2>
<h2><b>{{ name }}</b> status update on Penn Clubs</h2>
{% if approved %}
<p style="font-size: 1.2em; color: #228B22">
<b>🎉 Congratulations!</b> Your club {% if change %}changes have{% else %}has{% endif %} been approved by the <b>Office of Student Affairs</b> for the {{ year }} school year!
Your {% if change %}updated{% else %}new{% endif %} club information is now open to the public on Penn Clubs.
<p style="font-size: 1.2em;">
Your club {% if change %}changes have{% else %}has{% endif %} been approved by the <b>Office of Student Affairs</b> for the {{ year }} school year.
Your {% if change %}updated{% else %}new{% endif %} club information is now visible to the public on Penn Clubs.
</p>
{% if approved_comment %}
<p style="font-size: 1.2em; padding: 8px; border-left: 5px solid #ccc; white-space: pre-wrap;">{{ approved_comment }}</p>
{% endif %}
<p style="font-size: 1.2em">
You do not need to perform any further actions.
No further action is required at this time.
</p>
<p style="font-size: 1.2em">
You can view your club <a href="{{ view_url }}">here</a> and make further edits <a href="{{ view_url }}">here</a>.
If you have any feedback about the club renewal process, you can respond to this email or fill out <a href="https://airtable.com/shrCsYFWxCwfwE7cf">this form</a>.
You can view your club <a href="{{ view_url }}">here</a> and make further edits <a href="{{ edit_url }}">here</a>.
If you have any feedback about the club renewal process, please respond to this email or <a href="mailto:{% for email in reply_emails %}{% if not forloop.first %},{% endif %}{{ email }}{% endfor %}">contact the Office of Student Affairs</a>.
</p>
<p style="font-size: 1.2em">
Thank you for using Penn Clubs!
Thank you for using Penn Clubs.
</p>
{% else %}
<p style="font-size: 1.2em; color: #8B2222">
<b>Oh no!</b> Your club {% if change %}updates have{% else %}renewal has{% endif %} <b>not been approved</b> by the <b>Office of Student Affairs</b>. You will need to make changes to your club information before gaining approval.
<p style="font-size: 1.2em;">
Your club {% if change %}updates have{% else %}renewal has{% endif %} not been approved by the <b>Office of Student Affairs</b>. Some changes to your club information are required before approval can be granted.
</p>
<p style="font-size: 1.2em">The reason your club was not approved is shown below:</p>
<p style="font-size: 1.2em">The feedback regarding your club's status is as follows:</p>
<p style="font-size: 1.2em; padding: 8px; border-left: 5px solid #ccc;">{{ approved_comment }}</p>
<p style="font-size: 1.2em">You will need to <a href="{{ edit_url }}">make edits</a> to your club and press the button found <a href="{{ view_url }}">here</a> to apply again for approval.</p>
<p style="font-size: 1.2em">If you run into any issues with the approval process, you can respond to this email.</p>
<p style="font-size: 1.2em">Please <a href="{{ edit_url }}">make the necessary edits</a> to your club information and use the button <a href="{{ view_url }}">here</a> to resubmit for approval.</p>
<p style="font-size: 1.2em">
If you have any questions about the approval process, please feel free to respond to this email or <a href="mailto:{% for email in reply_emails %}{% if not forloop.first %},{% endif %}{{ email }}{% endfor %}">contact the Office of Student Affairs</a>.
</p>
<p style="font-size: 1.2em">
<a
style="text-decoration: none; padding: 5px 20px; font-size: 1.5em; margin-top: 20px; color: white; background-color: green; border-radius: 3px; font-weight: bold"
Expand Down
21 changes: 12 additions & 9 deletions backend/templates/emails/club_deletion.html
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
<!-- TYPES:
name:
type: string
branding_site_name:
type: string
branding_site_email:
type: string
reply_emails:
type: array
items:
type: string
-->
{% extends 'emails/base.html' %}

{% block content %}
<h2><b>{{ name }}</b> has been marked as deleted on {{ branding_site_name }}</h2>
<p style="font-size: 1.2em; color: #8B2222">
<b>Oh no!</b> Your club has <b>been removed</b> from {{ branding_site_name }} by the <b>Office of Student Affairs</b>.
<h2><b>{{ name }}</b> status update on Penn Clubs</h2>
<p style="font-size: 1.2em;">
Your club has been removed from Penn Clubs by the Office of Student Affairs.
</p>
<p style="font-size: 1.2em">
If you have any questions or concerns, please
respond to this email or <a href="mailto:{% for email in reply_emails %}{% if not forloop.first %},{% endif %}{{ email }}{% endfor %}">contact the Office of Student Affairs</a>.
</p>
<p style="font-size: 1.2em">If you believe this is an error, please contact <a href="mailto:{{ branding_site_email }}">{{ branding_site_email }}</a>.</p>
{% endblock %}
{% endblock %}

0 comments on commit 9486f1b

Please sign in to comment.