-
Notifications
You must be signed in to change notification settings - Fork 1
Add user synchronization #156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
if ( $current_status ) { | ||
switch ( $current_status ) { | ||
// If user is already subscribed, unsubscribed or transactional, don't change the status. | ||
case 'subscribed': | ||
case 'unsubscribed': | ||
case 'transactional': | ||
$subscribe_status = $current_status; | ||
break; | ||
|
||
// If user is cleaned, set the status as pending. | ||
case 'cleaned': | ||
$subscribe_status = 'pending'; | ||
break; | ||
|
||
// If user is archived, pending or anything else, set the status as per the subscribe status in settings. | ||
case 'archived': | ||
case 'pending': | ||
default: | ||
break; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For existing Mailchimp contacts, we mostly don't update the status according to the settings on the WP side. However, for statuses like cleaned
, archived
, and pending
, we do consider updating them based on the user sync settings.
Please let me know if you think we should handle this differently. Thanks!
Description of the Change
This PR adds functionality to sync WordPress users to Mailchimp. It provides options to select user roles to sync and to choose the subscription status for users in the user sync settings.
The feature allows manual syncing of all users at once using background processing and also listens for new user registrations and updates to existing users. Currently, the sync is one-way (WordPress → Mailchimp). The feature also includes a UI to view users that failed to sync, along with the associated error messages. I have created #157, to handle update subscription status from user profile separately.
Quick Demo:
Screen.Recording.2025-05-15.at.3.46.56.PM.mov
Closes #155
How to test the Change
Prerequisites:
Manual Sync:
Auto Sync:
Changelog Entry
Credits
Props @dkotter @jeffpaul @iamdharmesh
Checklist: