Question

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?

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top