Fix handling of mails with missing headers

This commit is contained in:
2020-01-21 15:56:08 +01:00
parent 9e5f51f6f5
commit 7a31c01955
2 changed files with 10 additions and 2 deletions

View File

@@ -353,7 +353,12 @@ class EMailNotification(BaseNotification):
"{}: generating notification email for '{}'".format(
queueid, recipient))
self.logger.debug("{}: parsing email template".format(queueid))
if "from" not in headers.keys():
headers["from"] = ""
if "to" not in headers.keys():
headers["to"] = ""
if "subject" not in headers.keys():
headers["subject"] = ""
# generate dict containing all template variables
variables = defaultdict(str,
EMAIL_HTML_TEXT=sanitized_text,