Alerting: Ensuring notifications displayed correctly in mobile device with Google Chat (#27578)

* Added previewText to Google Chat notifier

(cherry picked from commit 20292bdb0e)
This commit is contained in:
Alvaro Olmedo Rodriguez
2020-09-23 13:23:49 +02:00
committed by Leonard Gram
parent 0bac0044a9
commit bdeb380c56
@@ -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{
{