Commit a622c55b by 0x6875790d0a Committed by Torkel Ödegaard

(feat) Add image to LINE notify (#8771)

parent e6f9546a
...@@ -75,12 +75,17 @@ func (this *LineNotifier) createAlert(evalContext *alerting.EvalContext) error { ...@@ -75,12 +75,17 @@ func (this *LineNotifier) createAlert(evalContext *alerting.EvalContext) error {
body := fmt.Sprintf("%s - %s\n%s", evalContext.Rule.Name, ruleUrl, evalContext.Rule.Message) body := fmt.Sprintf("%s - %s\n%s", evalContext.Rule.Name, ruleUrl, evalContext.Rule.Message)
form.Add("message", body) form.Add("message", body)
if evalContext.ImagePublicUrl != "" {
form.Add("imageThumbnail", evalContext.ImagePublicUrl)
form.Add("imageFullsize", evalContext.ImagePublicUrl)
}
cmd := &m.SendWebhookSync{ cmd := &m.SendWebhookSync{
Url: lineNotifyUrl, Url: lineNotifyUrl,
HttpMethod: "POST", HttpMethod: "POST",
HttpHeader: map[string]string{ HttpHeader: map[string]string{
"Authorization": fmt.Sprintf("Bearer %s", this.Token), "Authorization": fmt.Sprintf("Bearer %s", this.Token),
"Content-Type": "application/x-www-form-urlencoded", "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
}, },
Body: form.Encode(), Body: form.Encode(),
} }
......
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