• Resolved ladydev

    (@ladydev)


    I’m using the MC4WP integration with the HTML Forms plugin to send subscriber details to MailChimp only in the instance where a user has checked the subscribe checkbox. Upon successful submission, users are redirected to a download page, additionally, subscriber tags should be sent to MailChimp. Everything is working except the subscriber tags.

    Testing signups with unique usernames and emails, the user info is pushed to MailChimp but there are no subscriber tags. I’m wondering what I am missing here:

    add_filter('mc4wp_integration_custom_subscriber_data', function (MC4WP_MailChimp_Subscriber $subscriber, $form_id) {
        if ($form_id == 250328) {
            $subscriber->tags[] = 'Tag1';
        } else if ($form_id == 250329) {
            $subscriber->tags[] = 'Tag2';
        }
        return $subscriber;
    }, 10, 2);
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Lap

    (@lapzor)

    Hi,

    I assume you’re using the custom integration method?
    The form ID won’t be available via an action argument, but it will e available via $_POST[‘_hf_form_id’]

    add_filter( 'mc4wp_integration_woocommerce_subscriber_data', function( MC4WP_MailChimp_Subscriber $subscriber ) {
    
    if (isset($_POST['_hf_form_id']) && $_POST['_hf_form_id'] == 250328) {
            $subscriber->tags[] = 'Tag 1';
        } else if (isset($_POST['_hf_form_id']) && $_POST['_hf_form_id'] == 250329) {
            $subscriber->tags[] = 'Tag 2';
    }
    
        return $subscriber;
    });

    Hope that helps. If you have any questions, please let me know!

    Thread Starter ladydev

    (@ladydev)

    Excellent! Thank you. It works perfectly.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Subscriber tags not added to MailChimp via MC4WP Integration’ is closed to new replies.