Forum
Contact Form not working?
Ive set up a contact form as below:
<perch:form id="contact" method="post" app="perch_forms">
<perch:content id="intro" type="textarea" label="Intro" textile="true" editor="markitup" size="m" />
<div>
<perch:label for="name">Name</perch:label>
<perch:input type="text" id="name" required="true" label="Name" />
<perch:error for="name" type="required">Please add your name</perch:error>
</div>
<div>
<perch:label for="phone">Phone</perch:label>
<perch:input type="text" id="phone" required="false" label="Phone" />
</div>
<div>
<perch:label for="email">Email</perch:label>
<perch:input type="email" id="email" required="true" label="Email" />
<perch:error for="email" type="required">Please add your email address</perch:error>
<perch:error for="email" type="format">Please check your email address</perch:error>
</div>
<div>
<perch:label for="branch">Preferred Branch</perch:label>
<perch:input type="select" options="Bangor|bangor@oasis-travel.co.uk, Lisburn|lisburn@oasis-travel.co.uk, Belfast (Howard Street)|belfast@oasis-travel.co.uk, Lisburn Road|lisburnroad@oasis-travel.co.uk, Holywood|holywood@oasis-travel.co.uk" id="branch" required="true" label="Branch" />
<perch:error for="branch" type="required">Please choose a branch</perch:error>
</div>
<div>
<perch:label for="message">Message</perch:label>
<perch:input type="textarea" id="message" required="true" label="Message" />
<perch:error for="message" type="required">Please add a message</perch:error>
</div>
<div>
<perch:input type="submit" id="submit" value="Send" />
</div>
<perch:success>
<perch:content id="success" type="textarea" label="Thank you message" textile="true" editor="markitup" />
</perch:success>
</perch:form>
And in the Email address(es) line I've put {branch}. myemail@email.com however none come through. Ive also changed it so that it is just myemail@email.com but it still doen't work? Ive updated to the latest perch and latest contact form app but to no avail.
Any suggestions?
Thanks
If you switch on debug and submit the form what do you get?
Debug Message SELECT * FROM perch2_pages WHERE pagePath='/contact/thankyou.php' LIMIT 1 SELECT regionKey, regionHTML FROM perch2_content_regions WHERE regionPage='/contact/thankyou.php' OR regionPage='*' ORDER BY regionPage DESC
It goes to /contact/thankyou.php on submission and this is what appears.
What happens if you disabled the redirection and try again?
No email but this debug message:
Debug Message SELECT DISTINCT settingID, settingValue FROM perch2_settings WHERE userID=0 SELECT * FROM perch2_forms WHERE formKey='contact' LIMIT 1 SELECT * FROM perch2_pages WHERE pagePath='/contact/' LIMIT 1 Sent email: "Contact form from website" to steven@designbyconet.com INSERT INTO perch2_forms_responses(responseJSON,formID,responseIP,responseSpamData) VALUES('{\"fields\":{\"name\":{\"attributes\":{\"type\":\"text\",\"id\":\"name\",\"required\":\"true\",\"label\":\"Name\"},\"value\":\"Steven Legge\"},\"phone\":{\"attributes\":{\"type\":\"text\",\"id\":\"phone\",\"required\":false,\"label\":\"Phone\"},\"value\":\"+447708699593\"},\"email\":{\"attributes\":{\"type\":\"email\",\"id\":\"email\",\"required\":\"true\",\"label\":\"Email\",\"placeholder\":\"you@company.com\"},\"value\":\"steven@designbyconet.com\"},\"branch\":{\"attributes\":{\"type\":\"select\",\"options\":\"Bangor|bangor@oasis-travel.co.uk, Lisburn|lisburn@oasis-travel.co.uk, Belfast (Howard Street)|belfast@oasis-travel.co.uk, Lisburn Road|lisburnroad@oasis-travel.co.uk, Holywood|holywood@oasis-travel.co.uk\",\"id\":\"branch\",\"required\":\"true\",\"label\":\"Branch\"},\"value\":\"lisburn@oasis-travel.co.uk\"},\"message\":{\"attributes\":{\"type\":\"textarea\",\"id\":\"message\",\"required\":\"true\",\"label\":\"Message\"},\"value\":\"This is a test, please reply.\"}},\"files\":[],\"page\":\"\/contact\/\"}','1','82.153.18.230','{\"fields\":[],\"environment\":{\"PATH\":\"\/bin:\/usr\/bin:\/sbin:\/usr\/sbin\",\"RAILS_ENV\":\"production\",\"SCRIPT_NAME\":\"\/contact\/index.php\",\"REQUEST_URI\":\"\/contact\/\",\"QUERY_STRING\":\"\",\"REQUEST_METHOD\":\"POST\",\"SERVER_PROTOCOL\":\"HTTP\/1.1\",\"GATEWAY_INTERFACE\":\"CGI\/1.1\",\"REMOTE_PORT\":\"53563\",\"SCRIPT_FILENAME\":\"\/home\/ftp_conet_customer_sites\/oasis-travel.co.uk\/contact\/index.php\",\"SERVER_ADMIN\":\"webmaster@oasis-travel.co.uk\",\"DOCUMENT_ROOT\":\"\/home\/ftp_conet_customer_sites\/oasis-travel.co.uk\",\"REMOTE_ADDR\":\"82.153.18.230\",\"SERVER_PORT\":\"80\",\"SERVER_ADDR\":\"64.90.57.208\",\"SERVER_NAME\":\"www.oasis-travel.co.uk\",\"SERVER_SOFTWARE\":\"Apache\",\"SERVER_SIGNATURE\":\"\",\"HTTP_COOKIE\":\"__utma=250923032.600771411.1395841715.1434704506.1434962007.84; __utmz=250923032.1433145721.77.3.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=(not%20provided); cmsa=1; PHPSESSID=1JcU1dUUKF23wj9qw8e7x3; _gat=1; _ga=GA1.3.600771411.1395841715\",\"HTTP_ACCEPT_LANGUAGE\":\"en-US,en;q=0.8,fr;q=0.6\",\"HTTP_ACCEPT_ENCODING\":\"gzip, deflate\",\"HTTP_REFERER\":\"https:\/\/www.oasis-travel.co.uk\/contact\/\",\"CONTENT_TYPE\":\"application\/x-www-form-urlencoded\",\"HTTP_USER_AGENT\":\"Mozilla\/5.0 (Windows NT 6.3; WOW64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/43.0.2357.130 Safari\/537.36\",\"HTTP_ORIGIN\":\"https:\/\/www.oasis-travel.co.uk\",\"HTTP_ACCEPT\":\"text\/html,application\/xhtml+xml,application\/xml;q=0.9,image\/webp,*\/*;q=0.8\",\"HTTP_CACHE_CONTROL\":\"max-age=0\",\"CONTENT_LENGTH\":\"248\",\"HTTP_CONNECTION\":\"close\",\"HTTP_HOST\":\"www.oasis-travel.co.uk\",\"DH_USER\":\"ftp_conet_customer_sites\",\"ds_id_17808006\":\"\",\"dsid\":\"17808006\",\"SCRIPT_URI\":\"https:\/\/www.oasis-travel.co.uk\/contact\/\",\"SCRIPT_URL\":\"\/contact\/\",\"UNIQUE_ID\":\"VZFctkBaOdAAAGU3F2MAAAAP\",\"FCGI_ROLE\":\"RESPONDER\",\"PHP_SELF\":\"\/contact\/index.php\",\"REQUEST_TIME_FLOAT\":1435589814.6311,\"REQUEST_TIME\":1435589814}}') SELECT * FROM perch2_forms_responses WHERE responseID='25' LIMIT 1 No ids to log. SELECT * FROM perch2_pages WHERE pagePath='/contact/index.php' LIMIT 1 SELECT regionKey, regionHTML FROM perch2_content_regions WHERE regionPage='/contact/index.php' OR regionPage='*' ORDER BY regionPage DESC
It looks like we're sending the email:
Definitely did not receive it Drew. Are there any other tests I could try?
I'll install 2.9 here and see if it fixes it maybe?
I don't doubt that you didn't receive it - but it looks like we're sending it.
If you're not on the latest version you certainly need to update, but this looks like an email issue rather than a Perch issue.