My case is pretty simple:
- I have a template for text / plain mail: body.txt
- Another text for text / html mails: body.html
The content of this mail is the same because I use EmailAlternative to send in the same mail.
body.txt
{% block message %}{% endblock %} {{ site_name }} team ----------------- If you need help contact use at {{ support_mail }}
body.html
<html> <head> <title>{% block title %}{% endblock %}</title> </head> <body> <p>{% filter linebreaksbr %}{% block message %}{% endblock %}{% endfilter %}</p> <p><strong>{{ site_name }} team</strong></p> <hr/> If you need help contact use at <a href="mailto:{{ support_mail }}">{{ support_mail }}</a> </body> </html>
Of course, this is a bit more complicated with translation, css and more than one block.
My desire is to define a .txt prompt :
{% block message %}Dear {{ first_name|title }} {{ last_name|upper }}, Your inscription has bee accepted. Welcome! {% endblock %}
I want to be able to upload (body.txt, .txt prompt) as well as (body.html, .txt prompt) to get my two html parts.
Edit:
Something like that:
invitation /body.txt
{% extends body.txt invitation.txt %}
invitation /body.html
{% extends body.html invitation.txt %}
Natim source share