• Resolved sierrasixmedia

    (@jadebartholomew)


    I have just created “contact form 7” forms on my website using gravity forms.
    I have downloaded the Mailchimp for WordPress plugin and have been using the Mailchimp checkbox on all forms with the checkbox already ticked.

    I added the below code to my functions.php folder as I had read to do that in another thread:

    add_filter( 'mc4wp_integration_contact-form-7_subscriber_data', function(MC4WP_MailChimp_Subscriber $subscriber, $cf7_form_id) {
       if ($cf7_form_id == 64472) {
           $subscriber->tags[] = 'General';
       } else if ($cf7_form_id == 64487) {
           $subscriber->tags[] = 'Newsletter';
       } else if ($cf7_form_id == 64494) {
           $subscriber->tags[] = 'SEO AUDIT';
     } else if ($cf7_form_id == 64496) {
           $subscriber->tags[] = 'content calender';
     } else if ($cf7_form_id == 64497) {
           $subscriber->tags[] = 'Future of digital marketing - Whitepaper';
     } else if ($cf7_form_id == 64498) {
           $subscriber->tags[] = 'Marketplaces - whitepaper';
     } else if ($cf7_form_id == 64499) {
           $subscriber->tags[] = 'Website Redesign - Whitepaper';
    } else if ($cf7_form_id == 64500) {
           $subscriber->tags[] = 'CEO Social Media - whitepaper';
       }
       return $subscriber;
    }, 10, 2);

    After adding the code, I tested one of the contact forms (id 64472) and then checked Mailchimp – the subscribed email was there with the correct tag (general) – great!

    However, when I tested another form (id 64487) using a DIFFERENT email address, and then checked Mailchimp, the contact was nowhere to be found. As well as the previous contact tagged ‘general’ had also disappeared.

    I’ve checked in archived and unsubscribed and can’t find the first tester anywhere. Now, none of the forms are sending contacts to Mailchimp.

    The forms are working, I know this as I have the “Contact Form Entries” plugin downloaded too.

    I do not understand why these are now not linking to Mailchimp at all, I’ve tried multiple email addresses on different forms and none of the contacts are being added to Mailchimp anymore.

    ps: I have tried to talk to Mailchimp but their support is terrible unless you’re on a paid plan.

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

    (@hchouhan)

    Hey @jadebartholomew,

    Thanks for reaching out to us.

    Before we discuss further, please clarify whether you are using “Contact Form 7” plugin or “Gravity Forms” plugin?

    Thread Starter sierrasixmedia

    (@jadebartholomew)

    oh sorry, i don’t know how gravity forms ended up there.

    I’m using contact form 7

    (I previously had gravity forms and am in the process of switching out the forms on my site)

    Plugin Contributor Harish Chouhan

    (@hchouhan)

    Hey @jadebartholomew,

    Thanks for clarifying. Please go to the “MC4WP > Others” menu in your WordPress admin and share with us the errors displayed there.

    Thread Starter sierrasixmedia

    (@jadebartholomew)

    Here’s what was listed:

    [2021-12-15 16:10:00] ERROR: Contact Form 7 > Mailchimp API Error: Bad Request. Invalid Resource. Your merge fields were invalid.
    - FNAME : Please enter a value
    Request:
    POST https://us19.api.mailchimp.com/3.0/lists/660e9f420a/members
    {"status":"subscribed","email_address":"bake*******@ho*****.co.uk","interests":{},"merge_fields":{},"email_type":"html","ip_signup":"92.20.22.192","tags":[]}
    Response:
    400 Bad Request
    {"type":"https://mailchimp.com/developer/marketing/docs/errors/","title":"Invalid Resource","status":400,"detail":"Your merge fields were invalid.","instance":"61083e05-d64e-2318-ee6b-3aec608fd1fb","errors":[{"field":"FNAME","message":"Please enter a value"}]}
    [2021-12-15 16:41:14] ERROR: Contact Form 7 > Mailchimp API Error: Bad Request. Invalid Resource. Your merge fields were invalid.
    - FNAME : Please enter a value
    Request:
    POST https://us19.api.mailchimp.com/3.0/lists/660e9f420a/members
    {"status":"subscribed","email_address":"alic**************@ho*****.com","interests":{},"merge_fields":{},"email_type":"html","ip_signup":"92.20.22.192","tags":["Newsletter"]}
    Response:
    400 Bad Request
    {"type":"https://mailchimp.com/developer/marketing/docs/errors/","title":"Invalid Resource","status":400,"detail":"Your merge fields were invalid.","instance":"1aa9570c-0f34-d278-33ab-26d9f902dfc2","errors":[{"field":"FNAME","message":"Please enter a value"}]}
    [2021-12-15 16:46:20] ERROR: Contact Form 7 > Mailchimp API Error: Bad Request. Invalid Resource. Your merge fields were invalid.
    - FNAME : Please enter a value
    Request:
    POST https://us19.api.mailchimp.com/3.0/lists/660e9f420a/members
    {"status":"subscribed","email_address":"kian*******@gm***.com","interests":{},"merge_fields":{},"email_type":"html","ip_signup":"92.20.22.192","tags":["Newsletter"]}
    Response:
    400 Bad Request
    {"type":"https://mailchimp.com/developer/marketing/docs/errors/","title":"Invalid Resource","status":400,"detail":"Your merge fields were invalid.","instance":"4bf2e641-4ec5-585b-c74e-0d21cbf2efd0","errors":[{"field":"FNAME","message":"Please enter a value"}]}
    [2021-12-15 17:11:52] ERROR: Contact Form 7 > Mailchimp API Error: Bad Request. Invalid Resource. Your merge fields were invalid.
    - FNAME : Please enter a value
    Request:
    POST https://us19.api.mailchimp.com/3.0/lists/660e9f420a/members
    {"status":"subscribed","email_address":"alic**************@ho*****.com","interests":{},"merge_fields":{},"email_type":"html","ip_signup":"92.20.22.192","tags":["Newsletter"]}
    Response:
    400 Bad Request
    {"type":"https://mailchimp.com/developer/marketing/docs/errors/","title":"Invalid Resource","status":400,"detail":"Your merge fields were invalid.","instance":"43f9aca8-1c14-656a-c718-294c9e07b2d0","errors":[{"field":"FNAME","message":"Please enter a value"}]}
    Thread Starter sierrasixmedia

    (@jadebartholomew)

    So it turns out I did archive the first test with the ‘general’ tag
    However, all of the emails I tested after are still not on the contact list.

    The 2 below the one tagged ‘general’ on the image were ones i tested before adding the code to the functions.php folder.
    The first test worked with the tag ‘general’ but every form I’ve tried since then has not added a contact to mailchimp

    See https://imgur.com/a/mAgKYjA

    Thread Starter sierrasixmedia

    (@jadebartholomew)

    @hchouhan

    Did you manage to find a solution for this problem?

    Thread Starter sierrasixmedia

    (@jadebartholomew)

    I have resolved this myself by following another thread

    I solved this issue by going to Mailchimp:
    all contacts > settings > Audience fields and *|MERGE|* tags > turn off required – name

    Plugin Contributor Harish Chouhan

    (@hchouhan)

    Hey @jadebartholomew,

    Thanks for the update. As the error suggested, it was due to a required field in MailChimp which if our forms do not send, then the subscription is rejected.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘mailchimp tags not working and now won’t subscribe users’ is closed to new replies.