Hello,
I’ve set up the Mailchimp integration by following some of the tutorials from the forum to parse the date of the event to my Mailchimp list into an EVENTDATE merge tag.
In addition to that, I would like to know what event they are attending based on the event category, for example, so that I can send them details specific to their event.
I sell different types of classes, so I will have different classes happen at different dates. I would like to set up a sophisticated automated system of emails: send an email to people who signed up to a certain class with the information on how to prepare for the class, then send a reminder 2 days before the event with the details specific to the event, then send an email the day after the event ended (some events are 2-day classes).
What is possible with the Mailchimp addon and what information can I pass to Mailchimp automatically?
So I looked up some code that allows to parse the event name and URLs to mailchimp.
So if instead of the event name I want to parse the event category, what should I use instead of $merge_vars['EVENTNAME'] = $event->name();
function tw_eea_mailchimp_event_name( $subscribe_args, $registration, $EVT_ID ) {
//Pull the event using EVT_ID.
$event = EEM_Event::instance()->get_one_by_ID($EVT_ID);
if( $event instanceof EE_Event ) {
//Pull the merge_vars array from $subscribe_args.
$merge_vars = $subscribe_args['merge_vars'];
//Add the 'EVENTNAME' merge var.
$merge_vars['EVENTNAME'] = $event->name();
//Add the merge vars back into the subscriptions args.
$subscribe_args['merge_vars'] = $merge_vars;
}
//Return the subscribe args.
return $subscribe_args;
}
add_filter('FHEE__EE_MCI_Controller__mci_submit_to_mailchimp__subscribe_args', 'tw_eea_mailchimp_event_name', 10, 3);
The support post ‘Parse event category or other parameters to Mailchimp’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.
Support forum for Event Espresso 3 and Event Espresso 4.