Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Customising the CMS /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Email from within onBeforeWrite function gives error None of these templates can be found in theme 'mytheme': MyTemplate.ss


Go to End


3 Posts   988 Views

Avatar
PumpkinHead

Community Member, 2 Posts

4 November 2014 at 3:43pm

Edited: 04/11/2014 3:45pm

I get this error when trying to populate an email template with data from within onBeforeWrite for my Order page. I want an email triggered in some circumstances when a record is saved. I have code elsewhere in the system that is loading the templates just fine, but those cases are all done from within controllers rather than a dataobject. Is there any reason I can't populate an email template from onBeforeWrite for a dataobject?

Avatar
Pyromanik

Community Member, 419 Posts

5 February 2015 at 5:42am

No, no reason. Both DataObjects and Controllers are ViewableData.

Did you flush?
Have you misspelt the names?

Did you accidentally edit in the wrong folder?

Avatar
kinglozzer

Community Member, 187 Posts

5 February 2015 at 6:27am

Further to the above, make sure you’ve set the theme in your config:

SSViewer:
  theme: 'mythemename'