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
Jinja2 templates not getting populated with body #46
Comments
Temporary solution is to use f-strings. Fortunately, setting the subtype to html still works to render those strings as html. |
@maestro-1 has done a great job on that. #21 has an example as well. What you are missing is specifying TEMPLATE_FOLDER in your config. |
you can access body dict keys in your html template as follows: {{ body.other }} it will render "some random string" in your template |
Thanks @wajeshubham for the explanation as well! As I see we gave examples, it should be now clear. if you have other issues please re-open the new issue. |
Hello Sir, I am trying to render html inside the the body using f string email is sent correctly but in the body, the html is displayed as the plain text along with html element as attached in below screenshot |
@Nikhilbk1705 can you show me an example? Thanks ",subtype='html', ) |
I'm trying to send an HTML rendered email with Jinja2 templates, but no context is being send.
Here's an example of the message I'm sending...
The email is sent correctly, and the template shows up as a rendered HTML email, but none of the information from the body parameter gets rendered.
The text was updated successfully, but these errors were encountered: