• Resolved jeromias

    (@jeromias)


    Hi,

    I have problem making MailChimp for WP work.

    I am using a hook for the registration, because I have another custom field to integrate.

    add_action( 'woocommerce_created_customer', 'wooc_save_register_notification' );
    function wooc_save_register_notification() {...

    I don’t handle anything inside the function regarding mailchimp. Should I?

    I have tried with two different mailchimp integrations, custom and registration.
    Here details:

    1) Custom (taken from Mailchimp for WP > Forms > Fields):
    Inside functions.php:

    add_action( 'register_form', 'wooc_extra_register_fields' );
    function wooc_extra_register_fields() {
      ?>
        <!p>
            <label>
                <input name="_mc4wp_action[]" type="checkbox" value="subscribe" checked> <span>Subscribe to our newsletter</span>
            </label>
        </p>
      <?php
    }

    Plugin settings:
    – Mailchimp is connected (green)
    – Mailchimp list is displayed
    – Mailchimp list -> checked
    – “use double opt-in?” -> yes
    – “update existing subscriber” -> yes
    – “replace interest groups” -> yes

    2) Registration Form integration:
    – enabled
    – “implicit” -> no
    – Mailchimp list -> checked
    – other settings like above

    In both cases I have the checkbox displayed in the registrations.

    Strange is that the first method doesn’t give me any error when I look at the plugin’s error log.
    The second method tell me “Registration Form > MailChimp API Error: LNAME must be provided – Please enter a value”

    As I said, nothing happens further in both cases.

    (sorry I cannot give the link to the site, it is still in testing for client)

    If anybody could give me some hints on what I am missing here.

    Thanks for help.

    Jerome

    https://www.ads-software.com/plugins/mailchimp-for-wp/

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Contributor Harish Chouhan

    (@hchouhan)

    Hello Jerome,

    You can just use the “Registration form” integration to add the sign-up checkbox to the registration form. You don’t need to use any custom function for the same.

    Regarding the error, can you please go to your MailChimp.com account and edit the field in your list to make the “LNAME” field as not required. Once this is done, please test and let us know if the data is sent to your MailChimp.com account.

    Thread Starter jeromias

    (@jeromias)

    Hi Harish,

    thanks for your reply and sorry I didn’t post yet my solution (due to all the work :), but yes, this is actually exactly how things got solved.
    I used the available Registration Form Integration, went to Mailchimp and selected LNAME as not required.
    I could still make use of the hook mentioned above to handle my other custom field.
    So everything went well at the end.

    I was though wondering: I’ve read in the documentation that I could send more fields to mailchimp using the prefix ‘mc4wp-‘ . I’ve tried using it on LNAME, defining the field name as ‘mc4wp-LNAME’, but it doesn’t seem to work… Is there a solution to that?

    Thanks again
    regards,
    Jerome

    Plugin Contributor Lap

    (@lapzor)

    Yes, you should be able to add fields that way, as described on https://mc4wp.com/kb/send-additional-cf7-fields-mailchimp/

    If that doesn’t seem to work for you, please contact us at [email protected] with your website details so we can take a look at your settings.

    Plugin Contributor Harish Chouhan

    (@hchouhan)

    Hello Jerome,

    Do you want to send the “LNAME” field through the Registration or WooCommerce integration?

    Thread Starter jeromias

    (@jeromias)

    Hi Lapzor, Harish,

    I am trying to add these fields through the Registration.
    Basically, that’s what I’ve done:
    1) adding extra fields to my registration:
    Firstname: …name=”mc4wp-FNAME” id=”mc4wp-FNAME”…
    Lastname: …name=”mc4wp-LNAME” id=”mc4wp-LNAME”…
    postcode: …name=”mc4wp-PCODE” id=”mc4wp-PCODE”…
    –> using hook “woocommerce_register_form_start”

    2) integration of mailchimp with the “Registration Form Integration” from the plugin

    3) in MailChimp itself, I have EMAIL, FNAME, LNAME, PCODE definded, and only EMAIL is set as required.

    4) I clicked “Renewed Mailchimp Lists” in the plugin’s settings too.

    The registration works fine and all the fields are saved in the database.
    I get the email from MailChimp to opt in.
    I click “Yes, subscribe me to the list” and land on the page “Update your preferences”. Strangely, only the email and first name have a value. Lastname and Postcode are there, but empty.
    I don’t understand why Firstname has a value but not the 2 others…

    I’ve tried defining the fields without prefix “mc4wp-” in the registration form. But no difference. Exactly the same result.
    I’ve also tried to place the lastname field before the firstname field… same result, only value of firstname is sent to MailChimp…

    Any ideas?

    Thanks again for your help on this.

    regards,
    Jerome

    Plugin Contributor Harish Chouhan

    (@hchouhan)

    Hello Jerome,

    We would need to test your website settings. Can you please email us at “support @mc4wp.com” with a link to this post?

    Plugin Contributor Harish Chouhan

    (@hchouhan)

    Hey Jerome,

    I’m marking this resolved here, as we are also discussing this through our private support channel.

    Hello I’m having the same issue… Trying to add custom inputs to registration exemple: <input id=”mce-FNAME” type=”text” name=”mc4wp-FNAME”>
    But I always get the error: Registration Form > MailChimp API Error: LNAME must be provided – Please enter a value
    Any help please?

    Plugin Contributor Lap

    (@lapzor)

    Hi Skoltz,

    Please make sure the field Last Name is not marked as required in your MailChimp.com account.

    Hi Lap,
    Then, the name is not filled in when I check in my subscribers list …
    Thank you for the reply.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Mailchimp for WP in Registration with woocommerce hook’ is closed to new replies.