Skip to content

Conversation

@jtwaleson
Copy link
Contributor

This is a first draft for adding templates to emails.

I noticed that I'd like to use Tera's extends syntax in my emails so that I can have one file with the layout of the html email and can just use smaller ones with message-specific layout bits.

Here we add a src/mailers/shared/{base.t,subject.t,text.t} and add these to the Tera context, so that en email templates you can just use {% extends "base.t" %}.

Before this change, this is not possible as we use the one_off rendering method and Tera has very little context.

Please let me know what you think.

@jtwaleson jtwaleson changed the title add ability to use templates in emails WIP: add ability to use Tera templates in emails Nov 19, 2025
@jtwaleson jtwaleson changed the title WIP: add ability to use Tera templates in emails WIP: add ability to use Tera template inheritence in emails Nov 19, 2025
@jtwaleson
Copy link
Contributor Author

This is related to #1652

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant