Hi there!
I am still in the process of learning all the good things that come with Grav.
Currently I’d like to replace my /email/templates/base.html.twig file with a custom designed email template.
I have tried adding a copy to my theme under /templates/email/base.html.twig and also tried /templates/partials/email/base.html.twig
I’ve had no luck with either.
This is likely under my nose somewhere, but I haven’t had any luck with overriding the default base.html.twig template. I also don’t see an option for defining a specific template in the form.md file.
Thank you for your help!
@rnjr It seems to be working OK in my installation:
- Copied folder ‘/user/plugins/email/templates/email’ to folder ‘/user/themes/mytheme/templates/’
- Changed style in ‘/user/themes/mytheme/templates/email/base.html.twig’ to:
h1, h2, h3 { ... color: red; }
- Send email using
$ bin/plugin email test-email -t <my email address>
- Received an email with a header in red…
Which theme are you using?
True, the message is six years old but, seen in a similar situation, I have realised that there is no point in overwriting the email template if in the form header you don’t indicate that it processes the email in the appropriate mode, either text mode or html mode.
form:
-
email:
body: '{% include ''forms/data.txt.twig'' %}'
Maybe @rnjr or someone else will find this detail useful.
Greetings!