Hi,
I want to show the event’s times (start and end) into the reservation email. I tried with %event_date% but i only get the date, not the time.
How can I print the time?
German Campos
I seem to recall this being requested before. I’ll be sure to add it to the 1.8 release.In the mean time you can add support for your own tags by with the following: http://wp-event-organiser.com/forums/topic/more-email-placeholders-particularly-venue-related-ones/
Stephen Harris
Hi Stephen,
I tried to add a tag to include the start time of my event, but I can’t make it work. This is my code:
add_filter( 'eventorganiser_email_template_tags', 'event_time_email_tag', 10, 3 );
function event_time_email_tag( $parsed_message, $booking_id, $original_message ){
//$parsed_message Email body with tags parsed
//$booking_id The booking ID
//$original_message Email body without tags parsed
$event_id = eo_get_booking_meta( $booking_id, 'event_id' );
$event = get_post( $event_id );
$time = eo_get_the_start('H:i', $event_id);
$parsed_message = str_replace( '%event_time%', $time, $parsed_message );
return $parsed_message;
}
Can you help me?
German Campos
You’ll probably need the occurrence too:
$event_id = eo_get_booking_meta( $booking_id, 'event_id' );
$occurrence_id = eo_get_booking_meta( $booking_id, 'occurrence_id' );
$event = get_post( $event_id );
$time = eo_get_the_start('H:i', $event_id, null, $occurrence_id );
$parsed_message = str_replace( '%event_time%', $time, $parsed_message );
summary: line (2) added and line (4) changed.
Stephen Harris