문제

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