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.

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Contact Page Submission


Reply


6 Posts   2283 Views

Avatar
Uncle Davey

Community Member, 10 Posts

23 May 2007 at 12:42pm

I am following tutorial 3 and up to the contact page form.

when I send the form I get this ...

FATAL ERROR: None of these templates can be found: SubmittedFormEmail.ss
At line 53 in /Library/WebServer/Documents/Sites/silverstripe/sapphire/core/SSViewer.php

What have I missed here?

Thanks for help.

Avatar
Sean

Forum Moderator, 922 Posts

23 May 2007 at 8:38pm

I'm surprised this was missed out. Here's the wiki page that explains the UserDefinedForm class in general

http://doc.silverstripe.com/doku.php?id=userdefinedform&s=submittedformemail

What you need to do is create a new template: mysite/templates/email/SubmittedFormEmail.ss, with the following:

<% if Data %>
<ul>
<% control Data %>
<li>$Title: $Value</li>
<% end_control %>
</ul>
<% end_if %>

I'll have a look at updating the tutorial - or at least place it in the requests. It wasn't clear that if you check 'email form' you had to create a new template for it to actually work.

Cheers,
Sean

Avatar
Uncle Davey

Community Member, 10 Posts

23 May 2007 at 9:20pm

Thanks for your reply Sean.

So I should be getting emails sent to the email designated in the CMS with the tick. Is it because I have not amended the mysite/_config.php correctly ?

Should it look like ... (Sorry - I am from a design background so I don`t know my PHP so well.)

<?
global $project;
$project = 'mysite';

global $databaseConfig;
$databaseConfig = array(
   "type" => "MySQLDatabase",
   "server" => "localhost",
   "username" => "root",
   "password" => "*****",
   "database" => "SS_mysite",
   
);

Email::setAdminEmail('my@emailaddress.co.nz');

?>

Your help is appreciated. Cheers.

Avatar
Sean

Forum Moderator, 922 Posts

24 May 2007 at 12:19am

Edited: 24/05/2007 12:22am

I believe the email address you set in _config.php with Email::setAdminEmail('some@email.com') is used for the 'from' email address for the emails. It doesn't affect who the email gets sent to. It will work without it, but won't have the sender's address, and it is preferred to have the site's admin email address set in Email::setAdminEmail(' '), as it also is used in some other classes.

The input for the email address of 'Send submission to' is where the email gets sent to when the form is submitted on the site. You can also send a copy of the submission to the person who filled it out by editing the details of an email field (the little notepad with pen icon), and checking 'Send a copy to this email address' or similar wording...

We're hoping to make it work without adding templates yourself (so it works completely independent out of the box). This way you can then override the templates if you're wanting more specific markup.

Hope this helps.

Cheers,
Sean

Avatar
Sean

Forum Moderator, 922 Posts

24 May 2007 at 12:27am

Also, I just thought of something else... if you're still unable to send emails, it could be that you need to tell PHP where the smtp server is (otherwise it can't send anything)... look for these lines in php.ini and fill them out as appropriate:

[mail function]
; For Win32 only.
SMTP = localhost
smtp_port = 25

; For Win32 only.
;sendmail_from = me@example.com

; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
;sendmail_path =

Hope this helps.

Cheers,
Sean

Avatar
Uncle Davey

Community Member, 10 Posts

24 May 2007 at 10:15am

Thanks for your time Sean.

I`m sorry but I`m still not receiving emails designated in the CMS with the "email submission to" checked (and filled out) to my everyday email inbox.

I`m on a Mac with www.silverstripe.dev as my virtual host domain.

I am unsure of what I need to fillout below:

[mail function]
; For Win32 only.
SMTP = localhost ### my smtp.ihug.co.nz ??? ###
smtp_port = 25

; For Win32 only.
;sendmail_from = me@example.com ### my email address ??? ###

; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
;sendmail_path = ### ??? ###

Thanks again.