• Resolved LS

    (@lsterling03)


    I am trying to add a custom function after a booking is submitted (bookings are auto-approved). I can’t find an action hook other than em_booking_status_changed. Can this be used to perform an action after a booking is submitted since our bookings approved by default? If so, how do I use the this hook?

    I tried something like this:

    add_action('em_booking_status_changed', 'create_draw_number', 10, 2);

    function create_draw_number($booking) {

    if ($booking->status == '1') {

    // the booking is approved, so do this

    }

    }

    Nothing happened, so I don’t think I’m checking for the status correctly. And/or this action doesn’t happen after a booking is made.

    Is this possible? Thank you!

    • This topic was modified 3 months, 4 weeks ago by LS.
    • This topic was modified 3 months, 4 weeks ago by LS.
Viewing 2 replies - 1 through 2 (of 2 total)
  • I would try using the em_booking_added action instead of em_booking_status_changed (since em_booking_status_changed doesn’t trigger when a booking is created).

    add_action('em_booking_added', 'create_draw_number', 10, 2);

    function create_draw_number($booking, $mail) {

    // the booking is saved and auto-approved, so do this

    }
    Thread Starter LS

    (@lsterling03)

    Thanks! em_booking_added worked for me.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.