From 20292bdb0e65e97192ab3d544350d79355180095 Mon Sep 17 00:00:00 2001 From: Alvaro Olmedo Rodriguez Date: Fri, 18 Sep 2020 08:41:34 +0200 Subject: [PATCH] Alerting: Ensuring notifications displayed correctly in mobile device with Google Chat (#27578) * Added previewText to Google Chat notifier --- pkg/services/alerting/notifiers/googlechat.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/services/alerting/notifiers/googlechat.go b/pkg/services/alerting/notifiers/googlechat.go index 123df9a7c5e..f66d04e486a 100644 --- a/pkg/services/alerting/notifiers/googlechat.go +++ b/pkg/services/alerting/notifiers/googlechat.go @@ -58,6 +58,7 @@ 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 { + PreviewText string `json:"previewText"` FallbackText string `json:"fallbackText"` Cards []card `json:"cards"` } @@ -195,6 +196,7 @@ func (gcn *GoogleChatNotifier) Notify(evalContext *alerting.EvalContext) error { // nest the required structs res1D := &outerStruct{ + PreviewText: evalContext.GetNotificationTitle(), FallbackText: evalContext.GetNotificationTitle(), Cards: []card{ {