Django Mail Builder¶
Build email messages from templates.
Contents:
Quick Start¶
Install the package
$ pip install django-mail-builder
Write a template
{% block subject %}Thanks for signing up to Awesome Site!{% endblock %} {% block to %}{{ user.email }}{% endblock %} {% block body %} Thanks for joining our site! We hope you love how awesome it is! {% endblock %} {% block html %} <h1> Thanks for joining our site! </h1> <p> We hope you love how awesome it is! {% endblock %}
In your view, build the message and send it.
msg = build_message('email/welcome.email', {'user': request.user}) msg.send()