Skip to content

Commit 84c67a6

Browse files
authored
Refactors and consolidates email templates (#763)
* Refactors and consolidates email templates * Renames generic to notification list
1 parent 707d253 commit 84c67a6

File tree

7 files changed

+13
-94
lines changed

7 files changed

+13
-94
lines changed

src/dispatch/messaging/email/templates/document_evergreen_reminder.mjml

Lines changed: 0 additions & 39 deletions
This file was deleted.

src/dispatch/messaging/email/templates/notification.mjml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,11 @@
33
<mj-section background-color="#ffffff" padding-left="15px" padding-right="15px">
44
<mj-column width="100%">
55
{% for item in items %}
6-
<mj-text>
7-
<ul style="list-style-type:none; padding-left: 0;">
8-
<li>
9-
<b><a href="{{ item.title_link }}" target="_blank" rel="noopener noreferrer">{{ item.title }}</a></b
10-
>
11-
</li>
12-
<li>{{ item.text }}</li>
13-
</ul>
6+
<mj-text color="#212b35" font-weight="bold" font-size="20px">
7+
<a href="{{ item.title_link }}" target="_blank" rel="noopener noreferrer">{{ item.title }}</a>
8+
</mj-text>
9+
<mj-text color="#212b35" font-size="16px">
10+
{{ item.text }}
1411
</mj-text>
1512
{% endfor %}
1613
</mj-column>

src/dispatch/messaging/email/templates/task_notification.mjml

Lines changed: 0 additions & 39 deletions
This file was deleted.

src/dispatch/messaging/email/utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ def get_template(message_type: MessageType):
2828
MessageType.incident_participant_welcome: ("notification.mjml", None),
2929
MessageType.incident_tactical_report: ("tactical_report.mjml", None),
3030
MessageType.incident_task_reminder: (
31-
"task_notification.mjml",
31+
"notification_list.mjml",
3232
INCIDENT_TASK_REMINDER_DESCRIPTION,
3333
),
3434
MessageType.document_evergreen_reminder: (
35-
"document_evergreen_reminder.mjml",
35+
"notification_list.mjml",
3636
DOCUMENT_EVERGREEN_REMINDER_DESCRIPTION,
3737
),
3838
MessageType.incident_feedback_daily_digest: (
39-
"feedback_notification.mjml",
39+
"notification_list.mjml",
4040
INCIDENT_FEEDBACK_DAILY_DIGEST_DESCRIPTION,
4141
),
4242
}

src/dispatch/messaging/strings.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -285,13 +285,13 @@ class MessageType(str, Enum):
285285
Thanks for participating in the {{name}} ("{{title}}") incident. We would appreciate if you could rate your experience and provide feedback."""
286286

287287
INCIDENT_TYPE_CHANGE_DESCRIPTION = """
288-
The incident type has been changed from *{{ incident_type_old }}* to *{{ incident_type_new }}*."""
288+
The incident type has been changed from {{ incident_type_old }} to {{ incident_type_new }}."""
289289

290290
INCIDENT_STATUS_CHANGE_DESCRIPTION = """
291-
The incident status has been changed from *{{ incident_status_old }}* to *{{ incident_status_new }}*."""
291+
The incident status has been changed from {{ incident_status_old }} to {{ incident_status_new }}."""
292292

293293
INCIDENT_PRIORITY_CHANGE_DESCRIPTION = """
294-
The incident priority has been changed from *{{ incident_priority_old }}* to *{{ incident_priority_new }}*."""
294+
The incident priority has been changed from {{ incident_priority_old }} to {{ incident_priority_new }}."""
295295

296296
INCIDENT_NAME_WITH_ENGAGEMENT = {
297297
"title": "{{name}} Incident Notification",

src/dispatch/report/messaging.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def send_tactical_report_to_tactical_group(
7878
# we load the incident instance
7979
incident = incident_service.get(db_session=db_session, incident_id=incident_id)
8080

81-
subject = f"{incident.name.upper()} - Tactical Report"
81+
subject = f"{incident.name} - Tactical Report"
8282
plugin.instance.send(
8383
incident.notifications_group.email,
8484
INCIDENT_TACTICAL_REPORT,
@@ -111,7 +111,7 @@ def send_executive_report_to_notifications_group(
111111
# we load the incident instance
112112
incident = incident_service.get(db_session=db_session, incident_id=incident_id)
113113

114-
subject = f"{incident.name.upper()} - Executive Report"
114+
subject = f"{incident.name} - Executive Report"
115115
plugin.instance.send(
116116
incident.notifications_group.email,
117117
INCIDENT_EXECUTIVE_REPORT,

0 commit comments

Comments
 (0)