forked from grafana/grafana
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathng_alert_notification.mjml
126 lines (110 loc) · 3.22 KB
/
ng_alert_notification.mjml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
<mjml>
<!-- global variables -->
<mj-include path="./partials/_globals.mjml" />
<!-- css styling -->
<mj-include path="./partials/layout/theme.css" type="css" css-inline="inline" />
<mj-head>
<!-- ⬇ Don't forget to specify an email subject below! ⬇ -->
<mj-title>
{{ Subject .Subject .TemplateData "{{ .Title }}" }}
</mj-title>
<mj-include path="./partials/layout/head.mjml" />
<!-- Summary of the email contents, this will go in the email preview -->
<mj-include path="./partials/alerting/summary.mjml" />
</mj-head>
<mj-body>
<mj-section>
<mj-include path="./partials/layout/header.mjml" />
</mj-section>
<!-- This is our grouping header, it says what grouping labels have been applied to this email -->
<mj-include path="./partials/alerting/grouping_labels.mjml" />
<!-- custom email message -->
<mj-raw>
{{ if .Message }}
</mj-raw>
<mj-wrapper css-class="background" padding="0">
<mj-section padding="0">
<mj-column>
<mj-text align="left">
<mj-raw>
{{ range $line := (splitList "\n" .Message) }}
</mj-raw>
{{ $line }}<br />
<mj-raw>
{{ end }}
</mj-raw>
</mj-text>
</mj-column>
</mj-section>
</mj-wrapper>
<!-- end custom email message -->
<mj-raw>
{{ else }}
</mj-raw>
<!-- default template -->
<!-- Firing instances -->
<mj-raw>
{{ if .Alerts.Firing }}
</mj-raw>
<!-- Firing header -->
<mj-section padding="0">
<mj-column>
<mj-text padding="0">
<h3>🔥 {{ .Alerts.Firing | len }} firing instances</h3>
</mj-text>
</mj-column>
</mj-section>
<!-- Firing instances loop -->
<mj-raw>
{{ range .Alerts.Firing }}
</mj-raw>
<mj-wrapper css-class="background" padding="0">
<mj-include path="./partials/alerting/firing_instance.mjml" />
<mj-include path="./partials/alerting/instance_details.mjml" />
</mj-wrapper>
<mj-section padding="10px" />
<!-- end Firing instances loop -->
<mj-raw>
{{ end }}
</mj-raw>
<!-- end Firing instances section -->
<mj-raw>
{{ end }}
</mj-raw>
<!-- Resolved instances -->
<mj-raw>
{{ if .Alerts.Resolved }}
</mj-raw>
<mj-section padding="0">
<mj-column>
<mj-text padding="0">
<h3>✅ {{ .Alerts.Resolved | len }} resolved instances</h3>
</mj-text>
</mj-column>
</mj-section>
<!-- Resolved instances loop -->
<mj-raw>
{{ range .Alerts.Resolved }}
</mj-raw>
<mj-wrapper css-class="background" padding="0">
<mj-include path="./partials/alerting/resolved_instance.mjml" />
<mj-include path="./partials/alerting/instance_details.mjml" />
</mj-wrapper>
<mj-section padding="10px" />
<!-- end Resolved instances loop -->
<mj-raw>
{{ end }}
</mj-raw>
<!-- end Resolved instances -->
<mj-raw>
{{ end }}
</mj-raw>
<!-- end default template -->
<mj-raw>
{{ end }}
</mj-raw>
<mj-section padding-top="10px">
<mj-include path="./partials/layout/footer.mjml" />
</mj-section>
</mj-body>
</mjml>