I’m trying to sign-up attendees who opt-in, to MailChimp. I’m using:
function afs_event_registration_callback($booking_id) {
$submit_data = array();
$submit_data['email'] = eo_get_booking_meta($booking_id, 'bookee_email', $single = true);
$submit_data['firstname'] = eo_get_booking_meta($booking_id, 'bookee_first_name', $single = true);
$submit_data['lastname'] = eo_get_booking_meta($booking_id, 'bookee_last_name', $single = true);
afs_mailchimp_post($submit_data, $list_id);
}
add_action('eventorganiser_new_booking', 'afs_event_registration_callback', 10, 1);
However the booking has an ‘incomplete’ status and the Ajax form still displays with no confirmation message. It looks like a 500 internal server error is happening as you can see in this image from dev tools.
https://imgur.com/a/8hymNIe
If I comment out the hook, the booking is confirmed fine. Is this the right hook to use for what I am trying to do?
Many thanks
Joan Conrow
I have sorted the 500 error which was a problem with a custom function (sorry). The booking now goes through as ‘confirmed’.
However the form not showing the success message is a still a problem: no confirmation is shown and it is confusing to users. Any ideas on how to debug this please?
Joan Conrow
So even if I use the redirect to a page option, nothing happens on screen after a booking is made.
The booking is made and a confirmation email is sent out.
Joan Conrow
OK, this is sorted now. A function written by a previous developer was echoing some content out which was preventing the redirect presumably by interfering with the EO Ajax call.
Joan Conrow
Hi Joan,
Glad you were able to this sorted.
Stephen Harris