Django Mail Builder

Build email messages from templates.

Contents:

Quick Start

  1. Install the package

    $ pip install django-mail-builder
    
  2. 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 %}
    
  3. In your view, build the message and send it.

    msg = build_message('email/welcome.email', {'user': request.user})
    msg.send()
    

Indices and tables