custom user fields in mailchimp
-
Hello,
I have a custom registration page and I am using following code to integrate mailchimp within my registration form
<p>
<label>
<input type=”checkbox” name=”mc4wp-subscribe” value=”1″ />
Subscribe to our newsletter. </label>
</p>
Also it is integrated with one of my mailing list in mailchimp. The problem is that when the user registers, only his email, first name and last name are imported into the mailing list.I also want rest of the fields to appear in the mailing list as well. The fields are updated in the mailchimp list once the usersync is run but it does not appear initially.I have phone, age, gender, visa etc fields
I came across the following function to get custom fields but it doesnt seem to work
add_filter( ‘mailchimp_sync_user_data’, function( $data, $user ) {
$data[‘MERGE3’] = $user->phone;
$data[‘MERGE5’] = $user->visa;
$data[‘MERGE6’] = $user->location;
$data[‘MERGE7’] = $user->age;
$data[‘MERGE8’] = $user->gender;
$data[‘MERGE9’] = $user->preference1;
$data[‘MERGE10’] =$user->preference2;
$data[‘MERGE11’] = $user->preference3;
$data[‘MERGE12’] = $user->mc4wp-subscribe;
return $data;
}, 10, 2 );
- The topic ‘custom user fields in mailchimp’ is closed to new replies.