Kaynağa Gözat

Add a link to a graph image in Pushover notifications (#8075)

Alfred Krohmer 8 yıl önce
ebeveyn
işleme
41171f8a5c
1 değiştirilmiş dosya ile 5 ekleme ve 1 silme
  1. 5 1
      pkg/services/alerting/notifiers/pushover.go

+ 5 - 1
pkg/services/alerting/notifiers/pushover.go

@@ -139,8 +139,12 @@ func (this *PushoverNotifier) Notify(evalContext *alerting.EvalContext) error {
 		}
 	}
 	if evalContext.Error != nil {
-		message += fmt.Sprintf("\n<b>Error message</b> %s", evalContext.Error.Error())
+		message += fmt.Sprintf("\n<b>Error message:</b> %s", evalContext.Error.Error())
 	}
+	if evalContext.ImagePublicUrl != "" {
+		message += fmt.Sprintf("\n<a href=\"%s\">Show graph image</a>", evalContext.ImagePublicUrl)
+	}
+
 	q := url.Values{}
 	q.Add("user", this.UserKey)
 	q.Add("token", this.ApiToken)