moved mail template rendering to jinja2 lib