def send_mail_jinja(subject, template, context, *args, **kwargs):
 autoescape_orig = env.autoescape
 env.autoescape = False
 template = env.get_template(template)
 msg = send_mail(subject, template.render(context), *args, **kwargs)
 env.autoescape = autoescape_orig
 return msg

def send_mail_jinja ( subject , template , context , * args , ** kwargs ) : autoescape_orig = env . autoescape env . autoescape = False template = env . get_template ( template ) msg = send_mail ( subject , template . render ( context ) , * args , ** kwargs ) env . autoescape = autoescape_orig return msg
sends mail using a jinja template with autoescaping turned off .