From 655ccc86b9dce6c7f334456175de5de6a2d98b99 Mon Sep 17 00:00:00 2001
From: Aaron Erkenswick <aaron.erkenswick@jwt.com>
Date: Wed, 13 Oct 2021 11:47:23 -0700
Subject: [PATCH] Add monitor name context to Slack fallback text.

The text block of a slack notification payload is used for mobile
devices and plain text previews. This change allows slack users to see
the name of the failing service without having to open up Slack to read
the entire message.
---
 server/notification-providers/slack.js | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/server/notification-providers/slack.js b/server/notification-providers/slack.js
index 5132ba977..b4dad6fe3 100644
--- a/server/notification-providers/slack.js
+++ b/server/notification-providers/slack.js
@@ -39,8 +39,9 @@ class Slack extends NotificationProvider {
             }
 
             const time = heartbeatJSON["time"];
+            const textMsg = "Uptime Kuma Alert";
             let data = {
-                "text": "Uptime Kuma Alert",
+                "text": monitorJSON ? textMsg + `: ${monitorJSON.name}` : textMsg,
                 "channel": notification.slackchannel,
                 "username": notification.slackusername,
                 "icon_emoji": notification.slackiconemo,