Skip to content

Instantly share code, notes, and snippets.

@hxer
Created May 5, 2019 04:27
Show Gist options
  • Save hxer/b9ea6d429263e91254f5b55670ec4cb3 to your computer and use it in GitHub Desktop.
Save hxer/b9ea6d429263e91254f5b55670ec4cb3 to your computer and use it in GitHub Desktop.
jinja2渲染HTML邮件
# -*- coding:utf-8 -*-
from jinja2 import Environment
from jinja2 import FileSystemLoader
if __name__ == "__main__"
data = {}
env = Environment(loader=FileSystemLoader('{0}/templates/'.format(os.path.dirname(__file__))))
template = env.get_template('risk_rule_daily.html')
html = template.render(**data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment