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
This commit is contained in:
Alvaro Olmedo Rodriguez 2020-01-13 20:42:52 +01:00 committed by Marcus Efraimsson
parent 1a810ebfe4
commit abc806e17b

View File

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