Update tags on existing subscriber

[ad_1]

I am using Contact Form 7 on a site where the subscribers are all landing in MailChimp, via the mc4wp plugin.

There are a number of different forms in play, so people might sign up to different things based on their areas of interest.

Eg. person 1 might sign up “whitepaper #1” and person 2 signs up to “whitepaper #2”. Down the track, person 1 might also sign up to “whitepaper #2”.

At some point in time, I am going to want to contact everyone who has signed up to “whitepaper #1”, so am passing tags for all forms. This is working as expected for the individual forms.

I have found though that I only ever get tagged on the first subscription, so in this instance person 1 only has the tag “whitepaper #1” (when I want them to be tagged later with “whitepaper #2”, when they have signed up to that).

At some other time, I want to send something to everyone tagged with “whitepaper #2”.

Is there a way to update / add tags to subscribers that already exist in the MC Audience?

This is what I am currently passing in functions.php:
add_filter( 'mc4wp_integration_contact-form-7_subscriber_data', function(MC4WP_MailChimp_Subscriber $subscriber, $cf7_form_id) {
if ($cf7_form_id == 6) {
$subscriber->tags[] = 'Overview';
} else if ($cf7_form_id == 2392) {
$subscriber->tags[] = 'Whitepaper - Vehicle Emissions';
} else if ($cf7_form_id == 2395) {
$subscriber->tags[] = 'Whitepaper - Parking Management';
} else if ($cf7_form_id == 589) {
$subscriber->tags[] = 'Other';
}
return $subscriber;
}, 10, 2);

Thanks!

The page I need help with: [log in to see the link]

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer