Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Contact Page Submission

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

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

Page: 1
Go to End
Author Topic: 2184 Views
  • Uncle Davey
    Avatar
    Community Member
    10 Posts

    Contact Page Submission Link to this post

    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.

  • Sean
    Avatar
    Forum Moderator
    921 Posts

    Re: Contact Page Submission Link to this post

    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

  • Uncle Davey
    Avatar
    Community Member
    10 Posts

    Re: Contact Page Submission Link to this post

    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.

  • Sean
    Avatar
    Forum Moderator
    921 Posts

    Re: Contact Page Submission Link to this post

    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

  • Sean
    Avatar
    Forum Moderator
    921 Posts

    Re: Contact Page Submission Link to this post

    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

  • Uncle Davey
    Avatar
    Community Member
    10 Posts

    Re: Contact Page Submission Link to this post

    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.

    2184 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.