Вопрос

Is it possible with SilverStripe 3 to create a default email template/style which is applied to all sent emails, without have to to override each email template separately?

Ideally this could be done as part of a theme.

I've tried defining a custom GenericEmail.ss template but it's been ignored thus far.

Looking at the framework source, creating a custom Email class and overriding the parseVariables() could possibly achieve it, but it seems like overkill?

Это было полезно?

Решение

After trying just now, the default email template can effectively be overriden with a custom one. I put mine under the "templates" folder of my theme (and not in any subfolder), ie /themes/mytheme/templates/GenericEmail.ss

Then tested after a flush=1 (so that the new template is picked up)

Hope this helps

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top