New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The subject block cannot be overwrite when inherit the email template. #28
Comments
As a workaround in your base template use the following markup:
And in your inherited templates:
Due to the way the parser for django's templates works, it's a manual/deep voodoo to get the inheritence to work properly, and needs revisiting to handle this case more effectively... |
Thank you very much! I should have thought of this workaround. Could you put that in the document? |
Perfect - would be great to have this in the Readme - have just spend half an hour trying to make this work! |
There was a related issue where inheritance wasn't working quite right, when I had nested blocks. I fixed it, and this original issue, by using I then replaced in
with:
Worked like a charm for me - templates now render correctly with all inheritances. That only changes the code for multipart emails - but that's all I'm using. A couple of extra lines would do it for HTML- or plain-only. |
I'm closing this in favor of fixing inheritence using django-block-render in #29 |
Is the subject block treated specially and did not get into the Django template inheritance process?
I had to use this work around that is put this in my base.email
{% block subject %}{{ subject }}{% endblock %}
And every time when call send email, the context need to have the subject line.
The text was updated successfully, but these errors were encountered: