Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jonashaag/django-mail-templated-simple
Much simpler, much more cooperative implementation of django-mail-templated
https://github.com/jonashaag/django-mail-templated-simple
Last synced: 3 months ago
JSON representation
Much simpler, much more cooperative implementation of django-mail-templated
- Host: GitHub
- URL: https://github.com/jonashaag/django-mail-templated-simple
- Owner: jonashaag
- License: other
- Created: 2014-11-13T03:52:11.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2019-11-27T15:49:53.000Z (about 5 years ago)
- Last Synced: 2024-09-12T23:45:23.386Z (4 months ago)
- Language: Python
- Size: 24.4 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Build Status](https://travis-ci.org/jonashaag/django-mail-templated-simple.svg?branch=master)](https://travis-ci.org/jonashaag/django-mail-templated-simple) [![codecov.io](https://codecov.io/github/jonashaag/django-mail-templated-simple/coverage.svg?branch=master)](https://codecov.io/github/jonashaag/django-mail-templated-simple?branch=master)
# django-mail-templated-simple
I did this reimplementation of [django-mail-templated](https://github.com/artemrizhov/django-mail-templated) because it was causing problems with
[django-celery-email](https://github.com/pmclanahan/django-celery-email) (see [#7](https://github.com/artemrizhov/django-mail-templated/issues/7), [#8](https://github.com/artemrizhov/django-mail-templated/issues/8)).In this version, `mail_templated.send_mail` is simply a wrapper around Django's `send_mail`.
Compatible with:
- Python 2.7, 3.4, 3.5, 3.6
- Django 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 1.10, 1.11## Usage
**Note:** Breaking change in version 3. You must now have your templates extend a base template, as follows:
```django
{% extends "mail_templated_simple/base.tpl" %}{% block subject %}Example subject, {{ foo }}{% endblock %}
{% block body %}
Example plaintext, {{ foo }}
{% endblock %}{% block html %}
Example html, {{ bar }}
{% endblock %}
```At least one of plaintext ``body`` and ``html`` is mandatory. ``subject`` is always mandatory.