Forum
Can't get mailchimp subscribe working in contact form
Hi Drew, I've added a join mailing list check box to a contact us form. The for is submitting and I'm receive an email with all the details however the mailchimp subscription isn't working.
Below is the form I'm using.
<perch:form id="contact" method="post" app="perch_mailchimp perch_forms" class="contact-form" double-optin="true">
<h1><perch:content id="heading" type="smarttext" label="Heading" textile="true" editor="markitup" /></h1>
<perch:content id="intro" type="textarea" label="Intro" textile="true" editor="markitup" size="m" />
<p>Fields marked with an<span class="mandatory">*</span>are required to be completed.</p>
<div>
<perch:label for="confirm" class="mailing group">Join our mailing list</perch:label>
<perch:input type="checkbox" value="1" id="confirm" mailer="confirm_subscribe" tabindex="10"/>
</div>
<div>
<perch:label for="message" >Message</perch:label>
<perch:input type="textarea" id="message" label="Message" tabindex="1"/>
</div>
<p class="instruct">Please provide us with your contact details… <br>
…don’t forget to include your address if you’re requesting samples.</p>
<div>
<perch:label for="name" class="group">Name<span class="mandatory">*</span></perch:label>
<perch:input type="text" id="name" required="true" label="Name" tabindex="2" class="short"/>
<perch:error for="name" type="required">Please add your name</perch:error>
</div>
<div>
<perch:label for="Telephone">Contact number</perch:label>
<perch:input type="tel" id="Telephone" label="Telephone" tabindex="3" placeholder="Landline or mobile" class="short"/>
</div>
<div>
<perch:label for="email">Email<span class="mandatory">*</span></perch:label>
<perch:input type="email" id="email" required="true" label="Email" placeholder="you@yourdomain.com" tabindex="4" class="short"/>
<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="house" class="group">Building Name/No. </perch:label>
<perch:input type="text" id="house" label="House No./Name" tabindex="5" class="short"/>
<perch:label for="street">Street</perch:label>
<perch:input type="text" id="street" label="Street" tabindex="6" class="short"/>
<perch:label for="town">Town/City</perch:label>
<perch:input type="text" id="town" label="Town/City" tabindex="7" class="short"/>
<perch:label for="county">County/State</perch:label>
<perch:input type="text" id="county" label="Town/City" tabindex="8" class="short"/>
<perch:label for="postcode">Postcode/Zip</perch:label>
<perch:input type="text" id="postcode" label="postcode" tabindex="9" class="short"/>
<perch:label for="country">Country</perch:label>
<perch:input type="text" id="country" label="country" tabindex="10" class="short"/>
</div>
<div class="hide">
<perch:label for="human">Please leave this field blank:</perch:label>
<perch:input type="text" id="human" antispam="honeypot" />
</div>
<div class="loginlast group">
<perch:label for="submit"> </perch:label><perch:input type="submit" id="submit" value="Submit" tabindex="11"/>
<perch:input type="hidden" id="list" value="XXXXXXXXXXX" mailer="list" />
</div>
<perch:success>
<div class="content-area">
<h1><perch:content id="success" type="text" label="Thank you title" textile="true" editor="markitup" /></h1>
<perch:content id="successmessage" type="textarea" label="Thank you message" textile="true" editor="markitup" />
</div>
</perch:success>
</perch:form>
Any pointers as to what I'm doing wrong. On the standalone mailchimp subscribe form the value of the submit button is Join, does this make a difference?
What output do you get from debug?
I can't see the form being posted there at all. Are you sure it's posting?
Are you sure that's not from the control panel?
Doh. Finally understood what you were after…
I think you're missing the
mailer="email"
attribute on your email field.