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.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

[solved] SS 3 - email templates, where do they go..

Go to End

3 Posts   2544 Views


Community Member, 267 Posts

10 November 2012 at 9:27am

Edited: 10/11/2012 9:29am


Im using SS 3.02, with a contactform class, uses a template to send the form data.
Where do i store the email template?

this is all wrong:

So what is the correct place?

class ContactPage extends Page{
	static $db = array(
		'Mailto' => 'Varchar(100)', 
		'SubmitText' => 'HTMLText',
	function getCMSFields() { 
		$fields = parent::getCMSFields(); 
		$fields->addFieldToTab("Root.OnSubmission", new TextField('Mailto', 'Email submissions to'));	
		$fields->addFieldToTab("Root.OnSubmission", new HTMLEditorField('SubmitText', 'Text on Submission'));	
		return $fields;

class ContactPage_Controller extends Page_Controller{
	static $allowed_actions = array(
	function ContactForm(){
		$fields = new FieldList(
            new TextField('Budget', 'Budget'),
            new TextField('Naam', 'Naam'),
            new TextField('Email', 'Email'),
            new TextareaField('Bericht', 'Bericht')
	    $actions = new FieldList(
	    	new FormAction('SendContactForm', 'Verstuur')
		$validator = new RequiredFields('Naam', 'Email', 'Bericht');
	    return new Form($this, 'ContactForm', $fields, $actions, $validator);
	function SendContactForm($data, $form){
		$From = $data['Email'];
		$To = $this->Mailto;
		$Subject = "Bericht via contactformulier";  	  
		$email = new Email($From, $To, $Subject);
		Director::redirect(Director::baseURL(). $this->URLSegment . "/?success=1");

	//The function to test whether to display the Submit Text or not
	public function Success(){
		return isset($_REQUEST['success']) && $_REQUEST['success'] == "1";

The error is:

[user warning] None of these templates can be found in theme 'Mytheme'

Line 633 in SSViewer.php


Community Member, 134 Posts

10 November 2012 at 11:37am

Edited: 10/11/2012 11:37am


You should name the file and place the file in your templates folder, either in mysite or your theme.

You seem to have named the file



Community Member, 267 Posts

12 November 2012 at 1:56am

Hi Joel,

it's solved now.
The problem was a flush

was testing with ?success=1