Create and assign e-mail templates in a plug-in

I was wondering if it’s possible to create my own e-mail templates in my own plugin and assign them so that I can keep my own “Kirby Boilerplate” as clean as the starterkit is and the e-mail templates will be updates via one central repository.

What I’ve tried is adding this chunk of code to my plugin’s index.php file, to see if these e-mail templates are being used but this doesn’t seem to work. As soon as I move those e-mail templates to /site/templates/emails/ it works, but as said that’s not my intention.

I’ve also tried to read myself into this topic, but unfortunately that didn’t help either :frowning:

// templates
'templates' => [
    'emails/auth.html' => __DIR__ . '/templates/emails/auth/login.html.php',
    'emails/auth.text' => __DIR__ . '/templates/emails/auth/login.php',
],

What are you trying to do here, set custom login.html? Then you should name it as such, not auth.html, but emails/auth/login.html

1 Like

Tried your suggestion and it works. Thanks! :bouquet: