%event_date% in email not showing time

WordPress Event Management, Calendars & Registration Forums Pre Sales Questions %event_date% in email not showing time

This topic contains 3 replies, has 2 voices, and was last updated by  Stephen Harris 9 years, 11 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #10946 Reply

    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
    #10965 Reply

    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
    #11065 Reply

    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
    #11094 Reply

    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
Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: %event_date% in email not showing time
Your information:




To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four 
    spaces will be stripped off, but all other whitespace
    will be preserved.
    
    Markdown is turned off in code blocks:
     [This is not a link](http://example.com)

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

For more help see http://daringfireball.net/projects/markdown/syntax


<a href="" title="" rel=""> <blockquote cite=""> <code> <pre> <em> <strong> <del datetime=""> <ul> <ol start=""> <li> <img src="" border="" alt="" height="" width=""> <p style=""> <span style="">