mirror of
https://github.com/grafana/grafana.git
synced 2025-08-06 20:59:35 +08:00
Alerting: Preserve new-lines from custom email templates in rendered email (#52253)
* Add line break, regenerate, and fix * Left-align custom text in addition to preserving newlines
This commit is contained in:
@ -1,3 +1,3 @@
|
||||
{{> body }}
|
||||
|
||||
Sent by Grafana v[[.BuildVersion]] (c) 2021 Grafana Labs
|
||||
Sent by Grafana v[[.BuildVersion]] (c) 2022 Grafana Labs
|
@ -4,6 +4,21 @@
|
||||
[[Subject .Subject "[[.Title]]"]]
|
||||
|
||||
[[ define "alert" ]]
|
||||
|
||||
[[ if ne .ImageURL "" ]]
|
||||
<tr>
|
||||
<td colspan="2" class="value">
|
||||
<img src="[[.ImageURL]]" class="fluid-centered" alt="Alerting Panel" />
|
||||
</td>
|
||||
</tr>
|
||||
[[ end ]]
|
||||
[[ if ne .EmbeddedImage "" ]]
|
||||
<tr>
|
||||
<td colspan="2" class="value">
|
||||
<img src="cid:[[.EmbeddedImage]]" alt="Alerting Chart Attached Below" />
|
||||
</td>
|
||||
</tr>
|
||||
[[ end ]]
|
||||
<tr>
|
||||
<td colspan="2" class="value">
|
||||
<span class="value-heading">Value:</span> <span class="value-value">[[ .ValueString ]]</span>
|
||||
@ -101,7 +116,7 @@
|
||||
[[ end ]]
|
||||
|
||||
[[ if gt (len .Message) 0 ]]
|
||||
[[ .Message ]]
|
||||
<div style="white-space: pre-line;" align="left">[[ .Message ]]</span>
|
||||
[[ else ]]
|
||||
|
||||
<style>
|
||||
|
Reference in New Issue
Block a user