Thanks. I was finally able to pass information from event manager to MailChimp for WordPress by using this function.
//Make Mailchimp and Event Manager see the FNAME and LNAME
add_filter( 'mc4wp_integration_events-manager_merge_vars', function( $vars ) {
$vars['FNAME'] = $_POST['first_name'];
$vars['LNAME'] = $_POST['last_name'];
return $vars;
});
So now I need to figure out how to add them to groups to a specific group.
I tried the above code and I’m not having any luck. The user is passed onto mail chimp but with no group information. Simply, they go into the MAIN list.
I got the grouping id from Mailchiimp for wordpress settings.
1. I went to “Your MailChimp Account” (obviously API is filled out).
2. Clicked on the list
3. It opened up 2 sections… Fields and Groupings
4. In Grouping I found the group I want that has the id next to it and I got the group title from the list i found the group name. Here is an image https://snag.gy/iSDmBY
So my CODE looks like this
add_filter( 'mc4wp_integration_events-manager_merge_vars', function( $vars ) {
if( ! isset( $vars['GROUPINGS'] ) ) {
$vars['GROUPINGS'] = array();
}
// create a grouping and add it to groupings data
$grouping = array(
'id' => 12xxx,
'groups' => array( 'Events' )
);
$vars['GROUPINGS'][] = $groupings_data;
return $vars;
});
What am I doing wrong? as it’s not working.. ?? any help would be greatly appreciated.