From ceb5d39b0d143689dec2f63ec1b5984440c9aafc Mon Sep 17 00:00:00 2001 From: liugq Date: Fri, 4 Aug 2023 22:06:02 +0800 Subject: [PATCH] support email content-type --- model/alerting/webhook.go | 1 + service/alerting/action/email.go | 1 + 2 files changed, 2 insertions(+) diff --git a/model/alerting/webhook.go b/model/alerting/webhook.go index a0ddc046..a314b480 100644 --- a/model/alerting/webhook.go +++ b/model/alerting/webhook.go @@ -20,4 +20,5 @@ type Email struct { } `json:"recipients" elastic_mapping:"recipients:{type:object}"` Subject string `json:"subject" elastic_mapping:"subject:{type:text}"` Body string `json:"body" elastic_mapping:"body:{type:text}"` + ContentType string `json:"content_type" elastic_mapping:"content_type:{type:keyword}"` } \ No newline at end of file diff --git a/service/alerting/action/email.go b/service/alerting/action/email.go index b7ad9647..5865e5b4 100644 --- a/service/alerting/action/email.go +++ b/service/alerting/action/email.go @@ -27,6 +27,7 @@ func (act *EmailAction) Execute()([]byte, error){ "variables": util.MapStr{ "subject": act.Subject, "body": act.Body, + "content_type": act.Data.ContentType, }, } emailMsgBytes := util.MustToJSONBytes(emailMsg)