From 3680e5b5915d15e0aef313f10e1a865a11700127 Mon Sep 17 00:00:00 2001 From: Manu Vamadevan <16459172+vsmanu@users.noreply.github.com> Date: Wed, 8 Mar 2023 18:08:19 +0100 Subject: [PATCH] grafana ticketing 81244 : Emails fails if the alert title has a newline char (#1499) # What this PR does Emails fails if the alert title has a newline char ## Which issue(s) this PR fixes Grafana tickets : 81244 ## Checklist - [x] Tests updated - [x] `CHANGELOG.md` updated --------- Co-authored-by: Vadim Stepanov --- CHANGELOG.md | 1 + engine/apps/email/alert_rendering.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5827bcd3..dca68bdb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Fixed issue with Alert group involved users filter +- Fixed email sending failure due to newline in title ## v1.1.34 (2023-03-08) diff --git a/engine/apps/email/alert_rendering.py b/engine/apps/email/alert_rendering.py index b3802d83..f9036a85 100644 --- a/engine/apps/email/alert_rendering.py +++ b/engine/apps/email/alert_rendering.py @@ -50,6 +50,6 @@ def build_subject_and_message(alert_group, emails_left): ) title = str_or_backup(templated_alert.title, title_fallback) - subject = f"[{title}] You are invited to check an alert group" + subject = f"[{title}] You are invited to check an alert group".replace("\n", "") return subject, content