Hi Stephen,
Is there any function that could use the organizers’ email address as the sender instead of the main admin email? or maybe something that will include the organizers’ emails as the reply header?
This way, when the registrant replies to the confirmation email, the message will reach the organizers/appropriate departments instead of the website administrator.
Thank you.
Harrison.O
Hi Harrison,
There is a filter for the email headers (including reply-to and from headers): eventorganiser_booking_confirmed_email_headers
.
(There is also the eventorganiser_bulk_email_headers
for if you bulk email attendees from the bookings admin page).
Not fully tested, but this should achieve what you’re after:
add_filter('eventorganiser_booking_confirmed_email_headers', function($headers, $booking_id) {
$event_id = eo_get_booking_meta( $booking_id, 'event_id' );
$organiser_id = (int) get_post_field( 'post_author', $event_id );
$user_info = get_userdata($organiser_id);
if($user_info){
$from_email = $user_info->display_name;
$from_name = $user_info->user_email;
$headers = array(
'from:' . stripslashes_deep( html_entity_decode( $from_name, ENT_COMPAT, 'UTF-8' ) ) . " <$from_email>",
'reply-to:' . $from_email
);
}
return $headers;
}, 10, 2);
Stephen Harris