Reply To: Booking confirmation

#9741

I tried adding this to the functions – the $venue doesn’t seem to do anything and not even the word “at” shows up on the booking email. I even tried messing with bookings-action.php itself, but it doesn’t seem to effect the email at all. Where am I going wrong. This is fairly urgent because there are events on the same date at two different venues.

add_filter( ‘eventorganiser_notify_confirmed_booking’, ‘ck_handle_confirmation_emails’, 10, 2 );
function ck_handle_confirmation_emails( $bool, $booking_id ){

$blogname = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
$post_id = (int) eo_get_booking_meta( $booking_id, 'event_id' );
$occurrence_id = (int) eo_get_booking_meta( $booking_id, 'occurrence_id' );
$event = get_the_title( $post_id );
    $venue = eo_get_venue_name ($booking_id);
$user_id = (int) eo_get_booking_meta( $booking_id, 'bookee' );


$hr= '<hr style="color:#E6E8E6;background-color:#E6E8E6;height:1px;border:0">';

$title =
    '<h2 style="display:block;font-family:Arial;font-size:30px;font-weight:bold;line-height:120%;margin-right:0;margin-bottom:15px;margin-left:0;text-align:left;color:#333 !important">'
    .__( 'New event booking', 'eventorganiserp' ).'</h2>';

$preamble = sprintf(
    '

'.__( 'A new booking has been made on your site %s:', 'eventorganiserp' ).'

' .'<h3 style="color:black;"> Booking #%d for %s %s at %s</h3>', $blogname, $booking_id, $event, $venue, empty( $occurrence_id ) ? '' : eo_get_the_start( '(jS F Y)', $post_id, null, $occurrence_id ) ); $booking_table = _eventorganiser_get_booking_table_for_email( $booking_id ); $bookee_details =sprintf( '<h3 style="color:black;"> %s </h3>

%s: %s

%s: %s

', __( 'Bookee', 'eventorganiserp' ), __( 'Username', 'eventorganiserp' ), eo_get_booking_meta( $booking_id, 'bookee_display_name' ), __( 'Email', 'eventorganiserp' ), eo_get_booking_meta( $booking_id, 'bookee_email' ) ); $postamble = sprintf( '

'.__( 'You can view the booking here', 'eventorganiserp' ). '

', eventorganiser_edit_booking_url( $booking_id ) ); $message = $title.$preamble.$booking_table.$hr.$bookee_details.$hr.$postamble; eventorganiser_mail( eo_get_booking_notification_email( $booking_id ), sprintf( __( '[%s] New Event Booking for %s', 'eventorganiserp' ), $blogname, $event ), $message, false, false, 'eo-email-template-event-organiser.php' );

}

Charlotte Kitto