Sync Role Name (with example code)
-
Love the option to sync user_meta with the list.
Please could you add the option to sync the user_role name into MailChimp.
Eg. If user_role = customer then we can push this into a field in MailChimp.
This would be super helpful.
I saw this code from another post:
add_filter( 'mailchimp_sync_user_data', function( $data, $user ) { $data['WEBSITE'] = $user->user_url; return $data; }, 10, 2 );Can you confirm we can amend as follows for an interim solution:
add_filter( 'mailchimp_sync_user_data', function( $data, $user ) { $user_roles = $user->roles; $user_role = array_shift($user_roles); $data['ROLE'] = $user_role; return $data; }, 10, 2 );
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Sync Role Name (with example code)’ is closed to new replies.