mirror of
https://github.com/grafana/grafana.git
synced 2025-01-10 08:03:58 -06:00
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:
parent
1a810ebfe4
commit
abc806e17b
@ -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{
|
||||
|
Loading…
Reference in New Issue
Block a user