[v10.0.x] Fix unwanted newlines in plain text email (#70168)
Fix unwanted newlines in plain text email (#70141)
(cherry picked from commit a3845c9e2e)
Co-authored-by: George Robinson <george.robinson@grafana.com>
This commit is contained in:
co-authored by
George Robinson
parent
9e6811995d
commit
01b07571b2
@@ -18,8 +18,8 @@ Go to the Alerts page: [[ .AlertPageUrl ]]
|
||||
[[- define "__default_alerts_summarize" -]]
|
||||
[[- range . ]]
|
||||
[[ template "__default_alert_labels" . ]]
|
||||
[[ template "__default_alert_annotations" . ]]
|
||||
[[- end ]]
|
||||
[[- template "__default_alert_annotations" . ]]
|
||||
[[ end ]]
|
||||
[[- end -]]
|
||||
|
||||
[[- define "__default_alert_labels" -]]
|
||||
@@ -32,21 +32,21 @@ Labels: [[ .Labels.SortedPairs ]]
|
||||
|
||||
[[- define "__default_alert_annotations" -]]
|
||||
[[- $annotations := .Annotations -]]
|
||||
[[- if index $annotations "summary" -]]
|
||||
Summary: [[ index .Annotations "summary" ]]
|
||||
[[- if index $annotations "summary" ]]
|
||||
Summary: [[ index .Annotations "summary" -]]
|
||||
[[- $annotations = $annotations.Remove (toStrings (list "summary")) ]]
|
||||
[[ end -]]
|
||||
[[- if index $annotations "description" -]]
|
||||
Description: [[ index $annotations "description" ]]
|
||||
[[- end -]]
|
||||
[[- if index $annotations "description" ]]
|
||||
Description: [[ index $annotations "description" -]]
|
||||
[[- $annotations = $annotations.Remove (toStrings (list "description")) ]]
|
||||
[[ end -]]
|
||||
[[- if index $annotations "runbook_url" -]]
|
||||
Runbook: [[ index $annotations "runbook_url" ]]
|
||||
[[- end -]]
|
||||
[[- if index $annotations "runbook_url" ]]
|
||||
Runbook: [[ index $annotations "runbook_url" -]]
|
||||
[[- $annotations = $annotations.Remove (toStrings (list "runbook_url")) ]]
|
||||
[[ end -]]
|
||||
[[- if $annotations -]]
|
||||
[[- end -]]
|
||||
[[- if $annotations ]]
|
||||
Annotations: [[ template "__default_sorted_pairs" $annotations ]]
|
||||
[[ end -]]
|
||||
[[- end -]]
|
||||
[[- end -]]
|
||||
|
||||
[[- define "__default_sorted_pairs" -]]
|
||||
|
||||
@@ -18,8 +18,8 @@ Go to the Alerts page: {{ .AlertPageUrl }}
|
||||
{{- define "__default_alerts_summarize" -}}
|
||||
{{- range . }}
|
||||
{{ template "__default_alert_labels" . }}
|
||||
{{ template "__default_alert_annotations" . }}
|
||||
{{- end }}
|
||||
{{- template "__default_alert_annotations" . }}
|
||||
{{ end }}
|
||||
{{- end -}}
|
||||
|
||||
{{- define "__default_alert_labels" -}}
|
||||
@@ -32,21 +32,21 @@ Labels: {{ .Labels.SortedPairs }}
|
||||
|
||||
{{- define "__default_alert_annotations" -}}
|
||||
{{- $annotations := .Annotations -}}
|
||||
{{- if index $annotations "summary" -}}
|
||||
Summary: {{ index .Annotations "summary" }}
|
||||
{{- if index $annotations "summary" }}
|
||||
Summary: {{ index .Annotations "summary" -}}
|
||||
{{- $annotations = $annotations.Remove (toStrings (list "summary")) }}
|
||||
{{ end -}}
|
||||
{{- if index $annotations "description" -}}
|
||||
Description: {{ index $annotations "description" }}
|
||||
{{- end -}}
|
||||
{{- if index $annotations "description" }}
|
||||
Description: {{ index $annotations "description" -}}
|
||||
{{- $annotations = $annotations.Remove (toStrings (list "description")) }}
|
||||
{{ end -}}
|
||||
{{- if index $annotations "runbook_url" -}}
|
||||
Runbook: {{ index $annotations "runbook_url" }}
|
||||
{{- end -}}
|
||||
{{- if index $annotations "runbook_url" }}
|
||||
Runbook: {{ index $annotations "runbook_url" -}}
|
||||
{{- $annotations = $annotations.Remove (toStrings (list "runbook_url")) }}
|
||||
{{ end -}}
|
||||
{{- if $annotations -}}
|
||||
{{- end -}}
|
||||
{{- if $annotations }}
|
||||
Annotations: {{ template "__default_sorted_pairs" $annotations }}
|
||||
{{ end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- define "__default_sorted_pairs" -}}
|
||||
|
||||
Reference in New Issue
Block a user