Commit abc806e1 by Alvaro Olmedo Rodriguez Committed by Marcus Efraimsson

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
parent 1a810ebf
...@@ -55,6 +55,7 @@ Structs used to build a custom Google Hangouts Chat message card. ...@@ -55,6 +55,7 @@ Structs used to build a custom Google Hangouts Chat message card.
See: https://developers.google.com/hangouts/chat/reference/message-formats/cards See: https://developers.google.com/hangouts/chat/reference/message-formats/cards
*/ */
type outerStruct struct { type outerStruct struct {
FallbackText string `json:"fallbackText"`
Cards []card `json:"cards"` Cards []card `json:"cards"`
} }
...@@ -187,6 +188,7 @@ func (gcn *GoogleChatNotifier) Notify(evalContext *alerting.EvalContext) error { ...@@ -187,6 +188,7 @@ func (gcn *GoogleChatNotifier) Notify(evalContext *alerting.EvalContext) error {
// nest the required structs // nest the required structs
res1D := &outerStruct{ res1D := &outerStruct{
FallbackText: evalContext.GetNotificationTitle(),
Cards: []card{ Cards: []card{
{ {
Header: header{ Header: header{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment