From c27994bda2d417ccadf33288662facdfc73011c5 Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Tue, 11 Dec 2018 18:14:07 +0100 Subject: [PATCH] allowing html in disqualification email need to add something to replace insecure --- rowers/emails.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rowers/emails.py b/rowers/emails.py index 826d43bb..4be99e9d 100644 --- a/rowers/emails.py +++ b/rowers/emails.py @@ -53,6 +53,9 @@ def textify(html): # Strip single spaces in the beginning of each line return text_only.replace('\n ', '\n').strip() +def newlinetobr(html): + return html.replace('\n','
') + def send_template_email(from_email,to_email,subject, template,context, *args,**kwargs): @@ -61,6 +64,7 @@ def send_template_email(from_email,to_email,subject, html_content = htmly.render(context) text_content = textify(html_content) + html_content = newlinetobr(html_content) if 'cc' in kwargs: msg = EmailMultiAlternatives(subject, text_content, from_email, to_email,cc=kwargs['cc'])