Custom email per event

This topic contains 1 reply, has 2 voices, and was last updated by  Stephen Harris 9 years, 1 month ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #21081

    Hi,

    My client has two events (let’s say Event A and Event B), once a booking has been confirmed they need to send the attendee a different confirmation email, which different content, depending on which event has been booked.

    I’ve had a look through the docs/codex and the only function I can find is – eventorganiser_booking_notification_email although I think this only lets me alter the email address that the standard booking notification is sent to.

    Is what I need to do possible?

    Thanks

    C

    Charlie Kirby
    #21097

    Hi Charlie,

    Yes, this is possible, the booking confirmation message is filtered using the eventorganiser_booking_confirmed_email_body filter. This passes a booking ID from which you can retrieve the corresponding event ID.

    So you can do the following:

     add_filter( 'eventorganiser_booking_confirmed_email_body', 'my_booking_confirmed_email', 10, 2 );
     function my_booking_confirmed_email( $message, $booking_id ) {
    
          $event_id = eo_get_booking_meta( $booking_id, 'event_id' );
    
          //change $message based on $event_id - you can use the email template tags
          $message = eventorganiser_email_template_tags( $message, $booking_id );
          $message = wpautop( $message );
    
          return $message;
     }
    
    Stephen Harris
Viewing 2 posts - 1 through 2 (of 2 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.