From 70ced8f8bfa3f2b52d7a94872be15e7a7dda8359 Mon Sep 17 00:00:00 2001 From: Adam Boutcher Date: Tue, 14 Sep 2021 12:17:11 +0100 Subject: [PATCH] Mattermost JSON --- notifiers/mattermost.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/notifiers/mattermost.go b/notifiers/mattermost.go index b5813c74..d7960168 100644 --- a/notifiers/mattermost.go +++ b/notifiers/mattermost.go @@ -35,9 +35,9 @@ var mattermoster = &mattermost{¬ifications.Notification{ Author: "Adam Boutcher", AuthorUrl: "https://github.com/adamboutcher", Delay: time.Duration(10 * time.Second), - Icon: "fab fa-comments", - SuccessData: null.NewNullString(`{ "blocks": [ { "type": "section", "text": { "type": "mrkdwn", "text": "The service {{.Service.Name}} is back online." } }, { "type": "actions", "elements": [ { "type": "button", "text": { "type": "plain_text", "text": "View Service", "emoji": true }, "style": "primary", "url": "{{.Core.Domain}}/service/{{.Service.Id}}" }, { "type": "button", "text": { "type": "plain_text", "text": "Go to Statping", "emoji": true }, "url": "{{.Core.Domain}}" } ] } ] }`), - FailureData: null.NewNullString(`{ "blocks": [ { "type": "section", "text": { "type": "mrkdwn", "text": ":warning: The service {{.Service.Name}} is currently offline! :warning:" } }, { "type": "divider" }, { "type": "section", "fields": [ { "type": "mrkdwn", "text": "*Service:*\n{{.Service.Name}}" }, { "type": "mrkdwn", "text": "*URL:*\n{{.Service.Domain}}" }, { "type": "mrkdwn", "text": "*Status Code:*\n{{.Service.LastStatusCode}}" }, { "type": "mrkdwn", "text": "*When:*\n{{.Failure.CreatedAt}}" }, { "type": "mrkdwn", "text": "*Downtime:*\n{{.Service.Downtime.Human}}" }, { "type": "plain_text", "text": "*Error:*\n{{.Failure.Issue}}" } ] }, { "type": "divider" }, { "type": "actions", "elements": [ { "type": "button", "text": { "type": "plain_text", "text": "View Offline Service", "emoji": true }, "style": "danger", "url": "{{.Core.Domain}}/service/{{.Service.Id}}" }, { "type": "button", "text": { "type": "plain_text", "text": "Go to Statping", "emoji": true }, "url": "{{.Core.Domain}}" } ] } ] }`), + Icon: "far fa-comments", + SuccessData: null.NewNullString(`{"text": "The service {{.Service.Name}} is back online."}`), + FailureData: null.NewNullString(`{"text": "The service {{.Service.Name}} has gone offline."}`), DataType: "json", RequestInfo: "Mattermost allows you to customize your own messages with many complex components.", Limits: 60,