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

* Added previewText to Google Chat notifier
This commit is contained in:
Alvaro Olmedo Rodriguez 2020-09-18 08:41:34 +02:00 committed by GitHub
parent 7e96b1f38b
commit 20292bdb0e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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{
{