By using this site, you agree to have cookies stored on your device, strictly for functional purposes, such as storing your session and preferences.

Dismiss

 email_send.py

View raw Download
text/x-script.python • 360 B
Python script, ASCII text executable
        
            
1
import config
2
from jinja2 import Environment, FileSystemLoader, select_autoescape
3
4
5
def render_email_template(template, **kwargs):
6
env = Environment(
7
loader=FileSystemLoader("email_templates"),
8
autoescape=select_autoescape(["html", "xml"])
9
)
10
template = env.get_template(template)
11
return template.render(**kwargs, config=config)
12