We are transitioning over to a new forum platform. Please post new issues there. Existing threads will be dealt with here unless you choose to move them over. Visit the new forum

Forum

Thread tagged as: Problem, MailChimp, Members

Members Registration Form + MailChimp Subscribe

I'm trying to get MailChimp integrated into the Members App registration form, but I'm not having much luck. MailChimp is configured correctly, and is syncing fine with the lists. The registration form just doesn't seem to add the subscribers.

I'm running the latest version of Perch, Members and MailChimp apps.

Here is my registration form template:

<perch:form id="register" method="post" app="perch_mailchimp perch_members" type="default" double-optin="true" send-welcome="true">
<div class="row">
    <div class="form-group">
        <div class="col-md-6">
            <perch:label for="first_name">First name <sup>*</sup></perch:label>
            <perch:input type="text" id="first_name" placeholder="First name" class="form-control" required="true" label="First name" mailer="FNAME" />
            <perch:error for="first_name" type="required">
                <div class="alert alert-danger mt-lg" role="alert">
                    Please add your first name
                </div>
            </perch:error>
        </div>
        <div class="col-md-6">
            <perch:label for="last_name">Last name <sup>*</sup></perch:label>
            <perch:input type="text" id="last_name" placeholder="Last name" class="form-control" required="true" label="Last name" mailer="LNAME" />
            <perch:error for="last_name" type="required">
                <div class="alert alert-danger mt-lg" role="alert">
                    Please add your last name
                </div>
            </perch:error>
        </div>
    </div>
</div>
<div class="row">
    <div class="form-group">
        <div class="col-md-6">
            <perch:label for="email">Email address <sup>*</sup></perch:label>
            <perch:input type="email" id="email" placeholder="Email address" class="form-control" required="true" helper="PerchMembers_Members::check_email" match-with="email2" mailer="email" />
            <perch:error for="email" type="required">
                <div class="alert alert-danger mt-lg" role="alert">
                    Please add your email address
                </div>
            </perch:error>
            <perch:error for="email" type="helper">
                <div class="alert alert-danger mt-lg" role="alert">
                    That email address is already in use
                </div>
            </perch:error>
        </div>
        <div class="col-md-6">
            <perch:label for="email2">Re-enter email address <sup>*</sup></perch:label>
            <perch:input type="email" id="email2" placeholder="Re-enter email address" class="form-control" required="true" />
            <perch:error for="email2" type="required">
                <div class="alert alert-danger mt-lg" role="alert">
                    Please re-enter your email address
                </div>
            </perch:error>
        </div>
        <div class="col-sm-12">
            <perch:error for="email" type="match">
                <div class="alert alert-danger mt-lg" role="alert">
                    Email addresses do not match
                </div>
            </perch:error>
        </div>
    </div>
</div>
<div class="row">
    <div class="form-group">
        <div class="col-md-6">
            <perch:label for="password">Password <sup>*</sup></perch:label>
            <perch:input type="password" id="password" placeholder="Password" class="form-control" required="true" match-with="password2" />
            <perch:error for="password" type="required">
                <div class="alert alert-danger mt-lg" role="alert">
                    Please add a password
                </div>
            </perch:error>
        </div>
        <div class="col-md-6">
            <perch:label for="password2">Re-enter password <sup>*</sup></perch:label>
            <perch:input type="password" id="password2" placeholder="Re-enter password" class="form-control" required="true" />
            <perch:error for="password2" type="required">
                <div class="alert alert-danger mt-lg" role="alert">
                    Please re-enter your password
                </div>
            </perch:error>
        </div>
        <div class="col-sm-12">
            <perch:error for="password" type="match">
                <div class="alert alert-danger mt-lg" role="alert">
                    Passwords do not match
                </div>
            </perch:error>
        </div>
    </div>
</div>
<div class="row">
    <div class="col-md-12 mt-sm">
        <perch:input type="submit" value="Register" class="btn btn-primary btn-lg mb-xlg" />
        <perch:input type="hidden" value="1" id="confirm" mailer="confirm_subscribe" />
        <perch:input type="hidden" id="list" value=“bddf256918” mailer="list" />
    </div>
</div>
<perch:success>
    <div class="alert alert-success mt-lg" role="alert">
        <strong>Thank you!</strong> You've successfully registered!
    </div>
</perch:success>
</perch:form>

This is the debug output on submission of the form:

Debug Message
[1] SELECT * FROM perch2_members_sessions WHERE sessionID='16ca1f17b3c857af2065d8f4dc1e0021c8812d63' AND sessionHttpFootprint='f0fedc30211335bc5be2146412db44f37d779117' AND sessionExpires>'2017-01-30 15:21:02' LIMIT 1
User is logged in
[1] SELECT * FROM perch2_pages WHERE pagePath='/register.php' LIMIT 1
[20] SELECT DISTINCT settingID, settingValue FROM perch2_settings WHERE userID=0
[0] SELECT COUNT(*) FROM perch2_members WHERE memberPassword IS NOT NULL AND memberEmail='joe.bloggs@test.com'
[1] SELECT * FROM perch2_mailchimp_lists WHERE listMailChimpID='' LIMIT 1
[0] SELECT COUNT(*) FROM perch2_members WHERE memberPassword IS NOT NULL AND memberEmail='joe.bloggs@test.com'
[1] SELECT * FROM perch2_members_forms WHERE formKey='register.default' LIMIT 1
INSERT INTO perch2_members(memberAuthType,memberEmail,memberPassword,memberStatus,memberCreated,memberProperties) VALUES('native','joe.bloggs@test.com','$P$BlyBJI6IA3B98GDLUTxPJc7kfQIwwJ0','pending','2017-01-30 15:21:07','{\"first_name\":\"Joe\",\"last_name\":\"Bloggs\",\"confirm\":\"1\",\"list\":\"\"}')
[1] SELECT * FROM perch2_members WHERE memberID='14' LIMIT 1
No ids to log.
UPDATE perch2_members SET memberAuthID='14', memberStatus='active' WHERE memberID='14'
No ids to log.
Using template: /templates/pages/attributes/default.html
Using sub-template: /templates/pages/attributes/seo.html
[3] SELECT * FROM perch2_pages WHERE pageNew=0 AND pageHidden=0 AND pageDepth >=0 AND pageDepth<=1 ORDER BY pageTreePosition ASC
[1] SELECT pageTreePosition FROM perch2_pages WHERE pagePath='/register.php' LIMIT 1
[1] SELECT pageID FROM perch2_pages WHERE pageTreePosition IN ('000-003', '000') ORDER BY pageTreePosition DESC
[3] Using template: /templates/navigation/item.html

I'm guessing the list ID should be getting added here? Any ideas where I'm going wrong?

[1] SELECT * FROM perch2_mailchimp_lists WHERE listMailChimpID='' LIMIT 1

Philip Gwynne

Philip Gwynne 1 points

  • 2 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Looks like you have some bad quote characters here:

<perch:input type="hidden" id="list" value=“bddf256918” mailer="list" />

Thanks Drew. Eyes like a hawk as always!