Forum

Thread tagged as: Question

Perch Forms, email template not showing

I'm creating a Perch form and while I have achieved the bare minimum requirements of client-side validation using HTML5, I would like to use a HTML template to submit the form to email clients.

I am aware I can have an auto-response email (I don't know if that takes a template) but in the options for the form after it has been submitted I don't see my email template located in /perch/templates/forms/email/

Thanks again for any assistance.

Garth Holmes

Garth Holmes 1 points

  • 6 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

I don't understand where you have got to so far. Can you explain the steps you have followed and include:

  1. Your template
  2. Your Diagnostics Report
Rachel Andrew

Rachel Andrew 394 points
Perch Support

That seems to be your form template, not an email template.

If this is a continuation of a previous thread then ideally post to that thread. If it is not then we always need your Diagnostics Report and template. Support gets busy - we won't remember the specifics of your project!

Form Template

<perch:form id="form-contact" method="post" app="perch_forms" role="form">
<table id="ContactTable">
<caption>Contact Form</caption>
<thead>
<tr>
<td>Please enter your contact details and message.</td>
</tr>
</thead>
<tbody>
<tr>
<td>
<perch:label for="name">Name</perch:label>
<perch:input id="name" type="text" label="Name" required="true" />
<perch:error for="name" type="required">Please type your name</perch:error>
</td>
</tr>
<tr>
<td>
<perch:label for="email">Email</perch:label>
<perch:input id="email" type="email" label="Email" required="true" placeholder="you@company.com" />
<perch:error for="email" type="required">Please add your email address</perch:error>
<perch:error for="email" type="format">Please enter a valid email address</perch:error>
</td>
</tr>
<tr>
<td>
<perch:label for="enquiry">Enquiry</perch:label>
<perch:input id="enquiry" type="select" label="Enquiry" required="true" options=", General Enquiry, Request Information, Other" />
<perch:error for="enquiry" type="required">Specify enquiry type</perch:error>
</td>
</tr>
<tr>
<td>
<perch:label for="message">Message</perch:label>
<perch:input id="message" type="textarea" label="Message" required="true" />
<perch:error for="message" type="required">Please include a message</perch:error>
</td>
</tr>
<tr>
<td><perch:input type="submit" id="submit" value="Send" class="submit"/></td>
</tr>
</tbody>
</table><perch:success><p>Thank you</p></perch:success>
</perch:form>

Email template

<html>
<head>
    <title>Form Submission</title>
</head>
<body>
    <h1>Form Submission</h1>
    <table>
        <tr>
            <th>Name</th>
            <td><perch:email id="name" /></td>
        </tr>
        <tr>
            <th>Email</th>
            <td><perch:email id="email" /></td>
        </tr>
        <tr>
            <th>Enquiry</th>
            <td><perch:email id="enquiry" /></td>
        </tr>
        <tr>
            <th>Message</th>
            <td><perch:email id="message" /></td>
        </tr>
    </table>
</body>
</html>

Diagnostics (summary)

    Perch: 2.8.6, PHP: 5.4.39, MySQL: mysqlnd 5.0.10 - 20111026 - $Id: c85105d7c6f7d70d609bb4c000257868a40840ab $, with PDO
    Server OS: Linux, cgi-fcgi
    Installed apps: content (2.8.6), assets (2.8.6), categories (2.8.6), perch_forms (1.8.3), perch_backup (1.2)
    App runtimes: <?php include(PERCH_PATH.'/core/apps/content/runtime.php'); include(PERCH_PATH.'/addons/apps/perch_forms/runtime.php'); ?>
    PERCH_LOGINPATH: /perch
    PERCH_PATH: /home/sitemaster/public_html/perch
    PERCH_CORE: /home/sitemaster/public_html/perch/core
    PERCH_RESFILEPATH: /home/sitemaster/public_html/perch/resources
    Image manipulation: GD
    PHP limits: Max upload 32M, Max POST 64M, Memory: 128M, Total max file upload: 32M
    Resource folder writeable: Yes
    DOCUMENT_ROOT: /home/sitemaster/public_html
    HTTP_HOST:
    REQUEST_URI: /perch/core/settings/diagnostics/
    SCRIPT_NAME: /perch/core/settings/diagnostics/index.php

I was using /email instead of /emails for the template location, however due to having an empty attribute value (HTML output):

<select id="form1_enquiry" name="enquiry" required="required"><option selected="selected" value=""></option><option value="General Enquiry">General Enquiry</option><option value="Request Information">Request Information</option><option value="Other">Other</option></select>

My form is not validating with w3c.

Drew McLellan

Drew McLellan 2638 points
Perch Support

In what way is it failing?