• Resolved dafsade

    (@dafsade)


    Hi
    I use MC4WP with a CF7 form. The form has a second acceptance (checkbox) field.
    If the user checks this checkbox I need to also add a specific tag to the subscriber.

    Below a code to explain what I need:

    add_filter( 'mc4wp_integration_contact-form-7_subscriber_data', function(MC4WP_MailChimp_Subscriber $subscriber, $cf7_form_id) {
        if ($cf7_form_id == 1274) {
            $subscriber->tags[] = 'apple';
            if (subscriber checked that checkbox) { // <== How I get that data?
               // add another specific tag "banana"
            }
        } else if ($cf7_form_id == 510) {
            // etc
        }
        return $subscriber;
    }, 10, 2);

    Thanks

    • This topic was modified 3 years, 6 months ago by dafsade.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Harish Chouhan

    (@hchouhan)

    Hey @dafsade,

    Thanks for reaching out to us.

    I regret to say this is beyond the scope of our support. You might need to contact CF7 support to get the details of how to query the form and get data based for the checkbox.

    Thread Starter dafsade

    (@dafsade)

    Hi,
    the filter mc4wp_integration_contact-form-7_subscriber_data isn’t a mc4wp filter? I thought it was in the scope of your plugin.

    Also the object MC4WP_MailChimp_Subscriber $subscriber seems yours.

    Just to understand how it works, thanks

    Plugin Contributor Lap

    (@lapzor)

    Hi,

    The example code that you referred to is for setting a tag per CF7 ID.

    You can adept that code to set a tag for different conditions, besides the CF7 form ID. You can reach the CF7 post data via $_POST.

    You may need a PHP programmer to write the needed custom code for you / to adept the code sample you referred to to make it do what you want.

    Kind regards,

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Get subscriber data’ is closed to new replies.