Closed rambo closed 1 year ago
Hi @rambo, right, at this point we thought, rendering the template with jinja could be done to HTML files, so the subtype should be HTML not plain. As I see your concerns, thinking could be that file content does not have HTML tags. Actually, we were thinking to remove template_body completely and keep body instead. This should not be overridden, you are right, the control should be given to the users.
Hey @rambo, below PR should solve your problem. Could you please also confirm it?
this is released in 1.3.0 version
if type is not set defaulting to HTML when message_body is used could make some sense and in any case should be done for backwards compatibility, but if type is explicitly set to plain then it should not be overridden.
https://github.com/sabuhish/fastapi-mail/blob/master/fastapi_mail/schemas.py#L82
Workaround is of course to just use Jinja yourself to render the body and not use template_body at all.