Hi- I tried switching to the SPF form, but didn't have any luck and wanted a little more control over it. I removed the recaptcha/spam hook and don't have anything in the modx error log. Specifically, here are my issues:
1. The contact page is not redirecting to the "thank you" page... or id=2... on submit.
2. The form is not sending the email to the
[email protected] address.
My code for all three places (snippet, resource, chunk) is below. Please let me know what errors you see and how I can correct this. Thanks for your help-- I'm super new to Modx!
This is my snippet:
/**
* FormIt
*
* Copyright 2009-2012 by Shaun McCormick <[email protected]>
*
* FormIt is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option) any
* later version.
*
* FormIt is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
* A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with
* FormIt; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
* Suite 330, Boston, MA 02111-1307 USA
*
* @package formit
*/
/**
* FormIt
*
* A dynamic form processing Snippet for MODx Revolution.
*
* @package formit
*/
require_once $modx->getOption('formit.core_path',null,$modx->getOption('core_path',null,MODX_CORE_PATH).'components/formit/').'model/formit/formit.class.php';
$fi = new FormIt($modx,$scriptProperties);
$fi->initialize($modx->context->get('key'));
$fi->loadRequest();
$fields = $fi->request->prepare();
return $fi->request->handle($fields);
[[!FormIt
&hooks=`email,redirect`
&emailTpl=`MyEmailChunk`
&emailSubject=`High Priority: Contact Form Submission from AmmoniaGauges.com`
&emailTo=`[email protected]`
&redirectTo=`2`
&validate=`name:required,
email:required,
phone:required,
subject:required,
text:required:stripTags`
]]
This is my resource page for the "contact us":
<div id="skip">
<a href="#side-content">Go to Navigation</a>
<a href="#main-content">Go to Content</a></div>
<div id="header" class="clear">
<p id="logo"><a href="/" title="De Mar & Associates. Providing High quality products since 1953">De Mar & Associates. Providing High quality products since 1953</a></p>
<p id="slogan">Family Owned & Operated. Call Us at 913.381.6810</p>
</div>
<div id="body" class="clear">
<!-- End Head -->
<div id="main-content">
</br>
[[!FormIt
&hooks=`email,redirect`
&emailTpl=`MyEmailChunk`
&emailSubject=`High Priority: Contact Form Submission from AmmoniaGauges.com`
&emailTo=`[email protected]`
&redirectTo=`2`
&validate=`name:required,
email:required,
phone:required,
text:required:stripTags`
]]
<h1>Contact Us Today!</h1>
</br>
[[!+fi.error_message:notempty=`<p>[[!+fi.error_message]]</p>`]]
<form action="[[~[[*id]]]]" method="post" class="form">
<input type="hidden" name="nospam:blank" value="" />
<label for="name">
Name: <input type="text" name="name" id="name" value="[[!+fi.name]]" />
<span class="error">[[!+fi.error.name]]</span>
</label>
</br>
<label for="phone">
Phone:
<input type="text" name="phone" id="phone" value="[[!+fi.phone]]" />
<span class="error">[[!+fi.error.phone]]</span>
</label>
</br>
<label for="email">
Email:
<input type="text" name="email" id="email" value="[[!+fi.email]]" />
<span class="error">[[!+fi.error.email]]</span>
</label>
</br>
<label for="text">
Questions/Comments: </br> <textarea name="text" id="text" cols="55" rows="7" value="[[!+fi.text]]">[[!+fi.text]]</textarea>
<span class="error">[[!+fi.error.text]]</span>
</label>
<div class="form-buttons">
<input type="submit" value="Send Inquiry" />
</div>
</form>
</div>
<div id="side-content">
<ul id="main-navigation">
<li><a href="[[~25]]" rel="nofollow">Home</a></li>
<li><a href="[[~10]]">About Us</a></li>
<li><a href="[[~12]]">Gauge Standard Features</a></li>
<li><a href="[[~22]]"> 8.5" Installations</a></li>
<li><a href="[[~6]]">Utility Grade Installations</a></li>
<li><a href="[[~7]]">Agricultural Installations</a></li>
<li><a href="[[~17]]">Panel Installations</a></li>
<li><a href="[[~3]]">Custom Gauge Designs</a></li>
<li><a href="[[~15]]" rel="nofollow">Contact Us</a></li>
</ul>
<div>
<a href="[[~15]]" rel="nofollow"><img class="image" src="/assets/images/cta-02.jpg" alt="Receive 10-15% discount off your first order" title="You Will Receive 10-15% Off Your First Order" /></a>
</div>
<address>
<p>De-Mar & Associates<br />
4490 Indian Creek Parkway<br />
Overland Park, KS 66207</p>
<p>Phone: 913.381.6810<br />
Fax: 913.381.9332<br />
Hours: 8:30am - 5pm CST</p>
<p><img src="/assets/images/overland-park.jpg" id="overland" alt="Overland Park Chamber of Commerce" /></p>
</address>
</div>
<div id="affiliates">
<h3>Our Groups & Associations</h3>
<div id="logo-block">
<ul class="clear">
<li><a href="http://www.NFIB.com" id="nfib" title="NFIB (National Federation of Independent Business) " rel="nofollow">nfib</a></li>
<li><a href="http://www.MANAonline.org" id="mana" title="Manufacturers' Agents National Association">mana</a></li>
<li><a href="http://www.ymcarockies.org" id="ymca" title="YMCA of the Rockies" rel="nofollow">ymca</a></li>
<li><a href="http://www.jamidamerica.org" id="junior-achv" title="Junior Achievement of Middle America, Inc." rel="nofollow">junior-achv</a></li>
<li><a href="http://www.bmtinfonet.org" id="bmt" title="Blood and Marrow Transplant Information Network" rel="nofollow">bmt</a></li>
</ul>
<ul class="clear">
<li><a href="http://www.stjude.org" id="st-jude" title="St. Judes Childrens Hospital" rel="nofollow">st-jude</a></li>
<li><a href="http://www.4spe.org" id="spe" title="SPE (Society of Plastics Engineers) ">spe</a></li>
<li><a href="http://www.childrensmercy.org" id="chldrn-mrcy" title="Children's Mercy" rel="nofollow">chldrn-mrcy</a></li>
<li><a href="http://www.kcashrae.org" id="shraea" title="ASHRAE - Kansas City Chapter " rel="nofollow">shraea</a></li>
<li><a href="http://www.unmc.edu" id="nmc" title="University of Nebraska Medical Center " rel="nofollow">nmc</a></li>
</ul>
</div>
</div></div>
<div id="footer">
<p>Copyright © 2007 De-Mar & Associates - Ammonia Gauges, All Rights Reserved <a href="/sitemap.html">Sitemap</a></p>
</div>
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-1952959-1");
pageTracker._initData();
pageTracker._trackPageview();
</script>
This is my email chunk:
This is the Formit Email Chunk.
<br />[[+name]] ([[+email]]) Wrote: <br />
[[+text]]
: