Skip to content
This repository was archived by the owner on Sep 3, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/dispatch/case/flows.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def case_add_or_reactivate_participant_flow(
welcome_template = email_template_service.get_by_type(
db_session=db_session,
project_id=case.project_id,
email_template_type=EmailTemplateTypes.welcome,
email_template_type=EmailTemplateTypes.case_welcome,
)

send_case_welcome_participant_message(
Expand Down Expand Up @@ -303,7 +303,9 @@ def case_new_create_flow(
)
oncall_name = oncall_service.name
except Exception as e:
log.error(f"Failed to get oncall service: {e}. Falling back to default oncall_name string.")
log.error(
f"Failed to get oncall service: {e}. Falling back to default oncall_name string."
)

send_event_paging_message(case, db_session, oncall_name)

Expand Down Expand Up @@ -1073,7 +1075,7 @@ def case_create_resources_flow(
welcome_template = email_template_service.get_by_type(
db_session=db_session,
project_id=case.project_id,
email_template_type=EmailTemplateTypes.welcome,
email_template_type=EmailTemplateTypes.case_welcome,
)

for user_email in set(individual_participants):
Expand Down
3 changes: 2 additions & 1 deletion src/dispatch/email_templates/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@


class EmailTemplateTypes(DispatchEnum):
welcome = "Incident Welcome Email"
case_welcome = "Case Welcome Email"
incident_welcome = "Incident Welcome Email"
2 changes: 1 addition & 1 deletion src/dispatch/incident/messaging.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ def send_incident_welcome_participant_messages(
welcome_template = email_template_service.get_by_type(
db_session=db_session,
project_id=incident.project_id,
email_template_type=EmailTemplateTypes.welcome,
email_template_type=EmailTemplateTypes.incident_welcome,
)

# we send the welcome ephemeral message
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<v-col cols="12">
<v-select
v-model="email_template_type"
:items="['Incident Welcome Email']"
:items="['Incident Welcome Email', 'Case Welcome Email']"
:menu-props="{ maxHeight: '400' }"
label="Email template type"
clearable
Expand All @@ -46,7 +46,7 @@
<v-textarea
v-model="welcome_text"
label="Welcome text"
hint="To insert the name of the incident, use {{name}}"
hint="To insert the name of the case/incident, use {{name}}"
clearable
name="Welcome text"
/>
Expand All @@ -55,7 +55,7 @@
<v-textarea
v-model="welcome_body"
label="Welcome body"
hint="To insert the name of the incident, use {{name}}"
hint="To insert the name of the case/incident, use {{name}}"
clearable
name="Welcome body"
/>
Expand Down
2 changes: 1 addition & 1 deletion tests/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -1256,7 +1256,7 @@ class EmailTemplateFactory(BaseFactory):
"""Email Template Factory."""

# Columns
email_template_type = EmailTemplateTypes.welcome
email_template_type = EmailTemplateTypes.incident_welcome
welcome_text = "Welcome to Incident {{title}} "
welcome_body = "{{title}} Incident\n{{description}}"
components = ["title", "description"]
Expand Down
Loading