From 28b5ca6488dd1b2bf59c9a62414d4a5ed3ca7f1d Mon Sep 17 00:00:00 2001 From: Jason Barnett Date: Tue, 16 Dec 2025 10:50:19 -0700 Subject: [PATCH] fix: correct Slack webhook example code in documentation - Fix ReferenceError by changing 'text: body' to 'text: body_markdown' on line 118 (the variable 'body' was never defined; should use 'body_markdown' from req.body) - Fix invalid_blocks API error by changing header block text type from 'mrkdwn' to 'plain_text' on line 122 (Slack's header block type only supports plain_text, not mrkdwn) - Rename 'title_markdown' to 'title' since the header block uses plain_text type, not markdown (variable names should reflect their actual content) These errors were preventing webhook messages from being sent to Slack. --- docs/admin/monitoring/notifications/slack.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/admin/monitoring/notifications/slack.md b/docs/admin/monitoring/notifications/slack.md index 99d5045656b90..394a63d70492b 100644 --- a/docs/admin/monitoring/notifications/slack.md +++ b/docs/admin/monitoring/notifications/slack.md @@ -89,11 +89,11 @@ To build the server to receive webhooks and interact with Slack: return res.status(400).send("Error: request body is missing"); } - const { title_markdown, body_markdown } = req.body; - if (!title_markdown || !body_markdown) { + const { title, body_markdown } = req.body; + if (!title || !body_markdown) { return res .status(400) - .send('Error: missing fields: "title_markdown", or "body_markdown"'); + .send('Error: missing fields: "title", or "body_markdown"'); } const payload = req.body.payload; @@ -115,11 +115,11 @@ To build the server to receive webhooks and interact with Slack: const slackMessage = { channel: userByEmail.user.id, - text: body, + text: body_markdown, blocks: [ { type: "header", - text: { type: "mrkdwn", text: title_markdown }, + text: { type: "plain_text", text: title }, }, { type: "section",