• Resolved Lautobus

    (@zerbil)


    Hi,

    I’ve seen this in another answer: “When you change a subscriber email in MailChimp it will create a new user with the new email in WordPress and keep the old user as well.”

    Is it possible to prevent and change this behaviour (maybe with “mailchimp_sync_webhook_user”)?

    Thanks

Viewing 1 replies (of 1 total)
  • Thread Starter Lautobus

    (@zerbil)

    Answer to myself:

    The “new user creation” is define at the end of file ‘mailchimp-sync.php’ inside the mailchimp_sync_webhook_user filter.
    As it’s define through a anonymous function I didn’t find a clean way to override it.
    The only solution I could find was to use ‘remove_all_filter’ and re-define a new custom filter.

    
    // Remove default webhook filter to avoid automatic user creation -> 'mailchimp-sync.php'
    remove_all_filters( 'mailchimp_sync_webhook_user', 10 );
    // define custom mailchimp_sync_webhook_user callback
    add_filter( 'mailchimp_sync_webhook_user', 'filter_mailchimp_sync_webhook_user', 10, 2 );
    function filter_mailchimp_sync_webhook_user( $user, $data ) {
    // action you want goes here
    }
    • This reply was modified 6 years ago by Lautobus.
    • This reply was modified 6 years ago by Lautobus.
    • This reply was modified 6 years ago by Lautobus.
Viewing 1 replies (of 1 total)
  • The topic ‘Prevent new user creation when Mailchimp subscriber change email’ is closed to new replies.