Skip to content

Commit 1d0b94c

Browse files
authored
zed: prettify slack notification message
This converts the body of a ZED slack notification from plain text to code block style to help with readability. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: George Melikov <mail@gmelikov.ru> Signed-off-by: René Wirnata <rene.wirnata@pandascience.net> Closes #17610
1 parent 2fd145b commit 1d0b94c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cmd/zed/zed.d/zed-functions.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,8 +441,9 @@ zed_notify_slack_webhook()
441441
"${pathname}")"
442442

443443
# Construct the JSON message for posting.
444+
# shellcheck disable=SC2016
444445
#
445-
msg_json="$(printf '{"text": "*%s*\\n%s"}' "${subject}" "${msg_body}" )"
446+
msg_json="$(printf '{"text": "*%s*\\n```%s```"}' "${subject}" "${msg_body}" )"
446447

447448
# Send the POST request and check for errors.
448449
#

0 commit comments

Comments
 (0)