Skip to content

Commit

Permalink
Improve reply emails code
Browse files Browse the repository at this point in the history
  • Loading branch information
aviupadhyayula committed Oct 11, 2024
1 parent 1c1b12f commit b519b29
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 13 deletions.
1 change: 1 addition & 0 deletions backend/clubs/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,7 @@ 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()
Expand Down
4 changes: 1 addition & 3 deletions backend/clubs/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2066,9 +2066,7 @@ 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,
"osa_email": settings.OSA_EMAILS[0],
"reply_emails": settings.OSA_EMAILS + [settings.BRANDING_SITE_EMAIL],
}
emails = (
club.get_officer_emails() + [self.request.user.email] + settings.OSA_EMAILS
Expand Down
11 changes: 9 additions & 2 deletions backend/templates/emails/approval_status.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
type: string
year:
type: number
reply_emails:
type: array
items:
type: string
-->
{% extends 'emails/base.html' %}

Expand All @@ -31,7 +35,7 @@ <h2><b>{{ name }}</b> status update on Penn Clubs</h2>
</p>
<p style="font-size: 1.2em">
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, you can respond to this email or fill out <a href="https://airtable.com/shrCsYFWxCwfwE7cf">this form</a>.
If you have any feedback about the club renewal process, you can respond to this email.
</p>
<p style="font-size: 1.2em">
Thank you for using Penn Clubs.
Expand All @@ -43,7 +47,10 @@ <h2><b>{{ name }}</b> status update on Penn Clubs</h2>
<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">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.</p>
<p style="font-size: 1.2em">
If you have any questions or concerns, please contact
<a href="mailto:{% for email in reply_emails %}{{ email }}{% if not forloop.last %},{% endif %}{% endfor %}">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
14 changes: 6 additions & 8 deletions backend/templates/emails/club_deletion.html
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
<!-- TYPES:
name:
type: string
branding_site_name:
type: string
branding_site_email:
type: string
osa_email:
type: string
reply_emails:
type: array
items:
type: string
-->
{% extends 'emails/base.html' %}

{% block content %}
<h2><b>{{ name }}</b> status update on Penn Clubs</h2>
<p style="font-size: 1.2em;">
Your club has been removed from {{ branding_site_name }} by the Office of Student Affairs.
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 contact
<a href="mailto:{{ branding_site_email }},{{ osa_email }}">the Office of Student Affairs</a>.
<a href="mailto:{% for email in reply_emails %}{{ email }}{% if not forloop.last %},{% endif %}{% endfor %}">the Office of Student Affairs</a>.
</p>
{% endblock %}

0 comments on commit b519b29

Please sign in to comment.