Skip to content

Commit

Permalink
Only use markdown for new incident participant message when participa…
Browse files Browse the repository at this point in the history
…nt weblink exists (#2174)
  • Loading branch information
mvilanova authored May 3, 2022
1 parent f794d75 commit 956f0a0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/dispatch/incident/messaging.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,15 +450,18 @@ def send_incident_participant_announcement_message(

participant_avatar_url = convo_plugin.instance.get_participant_avatar_url(participant_email)

# TODO these shouldn't be raw blocks (kglisson)
participant_name_mrkdwn = participant_name
if participant_weblink:
participant_name_mrkdwn = f"<{participant_weblink}|{participant_name}>"

blocks = [
{"type": "section", "text": {"type": "mrkdwn", "text": f"*{notification_text}*"}},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": (
f"*Name:* <{participant_weblink}|{participant_name}>\n"
f"*Name:* {participant_name_mrkdwn}\n"
f"*Team*: {participant_team}, {participant_department}\n"
f"*Location*: {participant_location}\n"
f"*Incident Role(s)*: {(', ').join(participant_roles)}\n"
Expand Down

0 comments on commit 956f0a0

Please sign in to comment.