def send_html_mail_jinja(subject, html_template, text_template, context, *args, **kwargs):
 with no_jinja_autoescape():
  html_template = get_env().get_template(html_template)
  text_template = get_env().get_template(text_template)
 msg = send_mail(subject, text_template.render(context), html_message=html_template.render(context), *args, **kwargs)
 return msg

def send_html_mail_jinja ( subject , html_template , text_template , context , * args , ** kwargs ) : with no_jinja_autoescape ( ) : html_template = get_env ( ) . get_template ( html_template ) text_template = get_env ( ) . get_template ( text_template ) msg = send_mail ( subject , text_template . render ( context ) , html_message = html_template . render ( context ) , * args , ** kwargs ) return msg
sends html mail using a jinja template with autoescaping turned off .