From abc806e17b2b63dc8dd7b512fd4769c24c381e74 Mon Sep 17 00:00:00 2001 From: Alvaro Olmedo Rodriguez Date: Mon, 13 Jan 2020 20:42:52 +0100 Subject: [PATCH] Alerting: fallbackText added to Google Chat notifier (#21464) Add fallbackText to Google Chat notifications. Definition of fallbackText: A plain-text description of the message's cards, used when the actual cards cannot be displayed, e.g. mobile notifications. Fixes #21463 --- pkg/services/alerting/notifiers/googlechat.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/services/alerting/notifiers/googlechat.go b/pkg/services/alerting/notifiers/googlechat.go index 2d81787fb91..c522161b34d 100644 --- a/pkg/services/alerting/notifiers/googlechat.go +++ b/pkg/services/alerting/notifiers/googlechat.go @@ -55,7 +55,8 @@ Structs used to build a custom Google Hangouts Chat message card. See: https://developers.google.com/hangouts/chat/reference/message-formats/cards */ type outerStruct struct { - Cards []card `json:"cards"` + FallbackText string `json:"fallbackText"` + Cards []card `json:"cards"` } type card struct { @@ -187,6 +188,7 @@ func (gcn *GoogleChatNotifier) Notify(evalContext *alerting.EvalContext) error { // nest the required structs res1D := &outerStruct{ + FallbackText: evalContext.GetNotificationTitle(), Cards: []card{ { Header: header{