Private
Public Access
1
0

allowing html in disqualification email

need to add something to replace insecure
This commit is contained in:
Sander Roosendaal
2018-12-11 18:14:07 +01:00
parent b499057fc1
commit c27994bda2

View File

@@ -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','<br>')
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'])