Merge pull request #3550 from alphagov/fix-html-escaping-email-subject-preview

Fix HTML being escaped in preview of email subject
This commit is contained in:
Chris Hill-Scott
2020-08-10 08:59:44 +01:00
committed by GitHub
2 changed files with 25 additions and 7 deletions

View File

@@ -3,6 +3,7 @@
from functools import partial
from flask import (
Markup,
Response,
abort,
flash,
@@ -438,14 +439,14 @@ def get_preview_of_content(notification):
))
if notification['template']['template_type'] == 'email':
return EmailPreviewTemplate(
return Markup(EmailPreviewTemplate(
notification['template'],
notification['personalisation'],
redact_missing_personalisation=True,
).subject
).subject)
if notification['template']['template_type'] == 'letter':
return LetterPreviewTemplate(
return Markup(LetterPreviewTemplate(
notification['template'],
notification['personalisation'],
).subject
).subject)