|
@@ -43,7 +43,17 @@ func (a *Alerter) alertEmail(
|
43
|
43
|
if err != nil {
|
44
|
44
|
return err
|
45
|
45
|
}
|
46
|
|
- body = fmt.Sprintf("%s\n\nLabels: %+v", body, string(jsonLabels))
|
|
46
|
+ body = fmt.Sprintf("%s\n\nLabels: %s", body, string(jsonLabels))
|
|
47
|
+ }
|
|
48
|
+
|
|
49
|
+ if len(data.Key) > 0 {
|
|
50
|
+ dataMap := make(map[string]string)
|
|
51
|
+ dataMap[data.Key] = data.Value
|
|
52
|
+ jsonData, err := json.Marshal(dataMap)
|
|
53
|
+ if err != nil {
|
|
54
|
+ return err
|
|
55
|
+ }
|
|
56
|
+ body = fmt.Sprintf("%s\n\nData: %s", body, string(jsonData))
|
47
|
57
|
}
|
48
|
58
|
|
49
|
59
|
body = fmt.Sprintf("%s\n\nScript:\n%s", body, script.Script)
|