From ed6087e233e0a8353c97824ba6160a0538f86f53 Mon Sep 17 00:00:00 2001 From: Frank Elsinga Date: Wed, 16 Oct 2024 16:50:41 +0200 Subject: [PATCH] fix: slack rich notification not working correctly (#5209) --- server/notification-providers/slack.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/notification-providers/slack.js b/server/notification-providers/slack.js index f28a643e..209c7c0c 100644 --- a/server/notification-providers/slack.js +++ b/server/notification-providers/slack.js @@ -32,7 +32,7 @@ class Slack extends NotificationProvider { * @param {object} monitorJSON The monitor config * @returns {Array} The relevant action objects */ - static buildActions(baseURL, monitorJSON) { + buildActions(baseURL, monitorJSON) { const actions = []; if (baseURL) { @@ -73,7 +73,7 @@ class Slack extends NotificationProvider { * @param {string} msg The message body * @returns {Array} The rich content blocks for the Slack message */ - static buildBlocks(baseURL, monitorJSON, heartbeatJSON, title, msg) { + buildBlocks(baseURL, monitorJSON, heartbeatJSON, title, msg) { //create an array to dynamically add blocks const blocks = []; @@ -150,7 +150,7 @@ class Slack extends NotificationProvider { data.attachments.push( { "color": (heartbeatJSON["status"] === UP) ? "#2eb886" : "#e01e5a", - "blocks": Slack.buildBlocks(baseURL, monitorJSON, heartbeatJSON, title, msg), + "blocks": this.buildBlocks(baseURL, monitorJSON, heartbeatJSON, title, msg), } ); } else {