• Resolved joeldude

    (@joeldude)


    Hello,

    Is there a way to remove the time from the {event-date} shortcode?

    I’m using this plugin to allow people to book an appointment, but if the event starts at 8:00am, the confirmation email they receive looks like they have booked an appointment for 8:00am. I’d rather the email just show the date of the event.

    Here’s the code:
    Hi {first},

    You have booked for {event-title} at {venue} on {event-date}. We are looking forward to having you there. The event will be held at this location:

    {venue-address}
    {venue-city}, {venue-state} {venue-zip}

    Please contact us should you have any questions or concerns, or if you did not make this appointment. Talk to you soon.

    Email looks like:
    Hi NAME,

    You have booked for Düsseldorf Show at Düsseldorf Show on January 18, 2019 8:00 am. We are looking forward to having you there. The event will be held at this location:

    etc…

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author roundupwp

    (@roundupwp)

    Hey Joel,

    Sure I can help you with this!

    Support for templates of just the individual pieces of the start and end date will likely make it into a future update but until then, try adding the following to your theme’s functions.php file:

    function ru_add_individual_date_template( $search_replace, $sanitized_data ) {
    	
    	$event_id = isset( $sanitized_data['event_id'] ) ? $sanitized_data['event_id'] : false;
    
    	if ( false !== $event_id ) {
    		if ( is_callable( 'tribe_get_start_date' ) && is_callable( 'tribe_get_end_date' ) ) {
    			$time_format = rtec_get_time_format();
    
    			$start_date = tribe_get_start_date( $event_id, false );
    			$start_time = tribe_get_start_date( $event_id, false, $time_format );
    			$end_date   = tribe_get_end_date( $event_id, false );
    			$end_time   = tribe_get_end_date( $event_id, false, $time_format );
    
    			$search_replace['{start-date}'] = $start_date;
    			$search_replace['{start-time}'] = $start_time;
    			$search_replace['{end-date}']   = $end_date;
    			$search_replace['{end-time}']   = $end_time;
    		}
    	}
    
    	return $search_replace;
    }
    add_filter( 'rtec_email_templating', 'ru_add_individual_date_template', 10, 2 );

    You can then use the template {start-date} to display just the date the event starts.

    – Craig

    Thread Starter joeldude

    (@joeldude)

    Great, thanks Craig. I’ll try that now and confirm it works.

    Thread Starter joeldude

    (@joeldude)

    Craig, this worked well. Thank you for the support!

    Plugin Author roundupwp

    (@roundupwp)

    No problem!

    Actually, from your other question here, it sounds like you’re using the “Pro” version. This template works without adding the PHP code in that case. If you’re using the free version, then this would be necessary at this point.

    Thanks,

    Craig

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Remove time from confirmation’ is closed to new replies.