allowing html in disqualification email
need to add something to replace insecure
This commit is contained in:
@@ -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'])
|
||||
|
||||
Reference in New Issue
Block a user