Forum

Thread tagged as: MailChimp

MailChimp App sorting into Groups with Checkboxes

I am trying to add checkboxes to the MailChimp form so when the user submits they can select if want to sign up to newsletter, linkedin or twitter groups within the list. Everything submits fine apart from the checkboxes.

Below is the code I am using:

<perch:form id="subscribe" app="perch_mailchimp perch_forms" double-optin="true" send-welcome="true">

    <perch:success>
        <p>Thank you!</p>
    </perch:success>

    <div>

        <perch:input id="firstname" required="true" type="text" mailer="NAME" placeholder="Name"/>
        <perch:error type="required" for="firstname">Required</perch:error>
    </div>
    <div>

    <perch:input id="organisation" required="true" type="text" mailer="ORG" placeholder="Organisation"/>
        <perch:error type="required" for="lastname">Required</perch:error>
    </div>

    <div>
        <perch:input id="email" required="true" type="email" mailer="email" placeholder="Email"/>
        <perch:error type="required" for="email">Required</perch:error>
    </div>


        <div class="col-md-12">
            <span class="check">SUBSCRIBE TO THE NEWSLETTER</span>
            <div class="roundedOne">
                <perch:input type="checkbox" id="NEWSLETTER" value="1" mailer="group[11561]-11561-0"/>
                <perch:label for="NEWSLETTER"></perch:label>
            </div>

            <span class="check">JOIN OUR LINKEDIN GROUP</span>
            <div class="roundedTwo">
                <perch:input type="checkbox" id="LINKEDIN" value="2"  mailer="group[11561]-11561-1"/>
                <perch:label for="LINKEDIN"></perch:label>
            </div>

            <span class="check">FOLLOW US ON TWITTER</span>
            <div class="roundedThree">
                <perch:input type="checkbox" id="TWITTER" value="4" mailer="group[11561]-11561-2"/>
                <perch:label for="TWITTER"></perch:label>
            </div>
        </div>  
    <div>
        <perch:input type="submit" value="Submit" id="btnsubmit" />
        <perch:input type="hidden" value="1" id="confirm" mailer="confirm_subscribe" />
    </div>  

</perch:form>
David Henderson

David Henderson 0 points

  • 7 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

What's the origin of the group[11561]-11561-2 values?

I was using the generated form that MailChimp offers then trying to customise it for Perch. Below is the code for the checkboxes from the MailChimp form:

<ul>
<li>
<input type="checkbox" value="1" name="group[11561][1]" id="mce-group[11561]-11561-0">
<label for="mce-group[11561]-11561-0">Subscribe to the Newsletter</label>
</li>

<li>
<input type="checkbox" value="2" name="group[11561][2]" id="mce-group[11561]-11561-1">
<label for="mce-group[11561]-11561-1">Join our Linked in group</label>
</li>

<li><input type="checkbox" value="4" name="group[11561][4]" id="mce-group[11561]-11561-2">
<label for="mce-group[11561]-11561-2">Follow us on Twitter</label>
</li>
</ul>
Drew McLellan

Drew McLellan 2638 points
Perch Support

I don't think the app supports subscribing the interest groups at the moment, looking at the code.

If you're interested in that, I'll log it as a request.

Hi Drew thanks for the help,

Yea I think it would be a good feature to add to the app. Would you have any ideas for a work around as this is a requirement needed for the site I am building at the min.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Is sticking with the basic MailChimp form an option?