sunscrapers / django-templated-mail

Send emails using Django template system.
MIT License
95 stars 21 forks source link

Allow extending a base template #22

Open rafaponieman opened 3 years ago

rafaponieman commented 3 years ago

I found that it's possible to extend a template, but only replacing the actual html_body and text_body blocks. However, if I make a base template like the following:

{% block html_body %}
<!DOCTYPE html>
<html>
<head>
    <title>Email</title>
</head>
<body>
  {% block html_content %}{% endblock %}
</body>
</html>
{% endblock %}

{% block text_body %}{% block text_content %}{% endblock %}{% endblock %}

And then replace html_content and text_content, it will render perfectly with a standard TemplateView, but it will turn out empty using BaseEmailMessage.

pranithan-kang commented 8 months ago

this issue is related to #10