From a3845c9e2ec57ea86696e8b798bbbb1bc18c2927 Mon Sep 17 00:00:00 2001 From: George Robinson Date: Thu, 15 Jun 2023 15:04:10 +0100 Subject: [PATCH] Fix unwanted newlines in plain text email (#70141) --- emails/templates/ng_alert_notification.txt | 26 +++++++++++----------- public/emails/ng_alert_notification.txt | 26 +++++++++++----------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/emails/templates/ng_alert_notification.txt b/emails/templates/ng_alert_notification.txt index cc8e1ab8c11..7bc954243c8 100644 --- a/emails/templates/ng_alert_notification.txt +++ b/emails/templates/ng_alert_notification.txt @@ -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" -]] diff --git a/public/emails/ng_alert_notification.txt b/public/emails/ng_alert_notification.txt index a6d224a7380..7334f08f5e8 100644 --- a/public/emails/ng_alert_notification.txt +++ b/public/emails/ng_alert_notification.txt @@ -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" -}}