Home How can I sync Wordpress user meta to MailChimp status field (subscribed/unsubscribed)
Reply: 0

How can I sync Wordpress user meta to MailChimp status field (subscribed/unsubscribed)

user834
1#
user834 Published in April 19, 2018, 10:03 am

I am using the "MailChimp User Sync" plugin to sync different user meta tags to different list fields and everything works fine.

However, I need to sync a specific WP user meta to the "EMAIL MARKETING" list field, the one that responds for Subscribe/Unsubscribe status.

Basically, there is a "Opt in/Opt out" WP user meta and when it changes to false, I want the status in MailChimp to change to UNSUBSCRIBED.

add_filter( 'mailchimp_sync_user_data', function( $data, $user ) {
    $data['status'] = $user->getEmailStatus;
    return $data;
}, 10, 2 );

The above code doesn't work for the 'status' field, though it works for other fields.

Is that possible to achieve in general with this plugin ?

Would highly appreciate any help

Regards,

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.36925 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO