• Cealin

    (@cealin)


    Hello,

    Is there an add-on for this plugin I can buy that makes it possible to have an email reminder be send to customers one day before their booked start date?

    Eg: someone booked a product for 2 December until 7 December. On 1 December this customer receives an automatic email reminding about the booking?

    Kind regards,
    Cealin

Viewing 1 replies (of 1 total)
  • Plugin Author Ashanna

    (@morki)

    Hello,

    You can do this:

    In Easy Booking > Settings > Booking statuses, set “Keep start status for” to “1” (so Start status is set 1 day before start date).

    Then, add the following code to your theme’s functions.php:

    add_action( 'wceb_order_item_status_start', 'wceb_send_email', 10, 1 );
    
    function wceb_send_email( $item_id ) {
    
        $order_item = WC_Order_Factory::get_order_item( $item_id );
        $order_id = $order_item->get_order_id();
        $order = wc_get_order( $order_id );
    
        $order->add_order_note( 'Your booking starts tomorrow', 1 );
    
    }

    Note that this will be sent for each order item. You can send only one email per order using this code instead:

    add_action( 'wceb_order_booking_status_changed', 'wceb_send_email_notification', 10, 2 );
    
    function wceb_send_email_notification( $order_id, $item_statuses ) {
    
        if ( array_key_exists( 'wceb-start', $item_statuses ) ) {
    
            $order = wc_get_order( $order_id );
            $order->add_order_note( 'Your bookings start tomorrow.', 1 );
           
        }
    
    }

    Now please note that this could not work 100%. I invite you to read this article where I explain how it works and why it’s not perfect (“Email notifications” at the end).

    I hope this helps ??

    Regards,
    Natasha

Viewing 1 replies (of 1 total)
  • The topic ‘Reminder email one day before start of booked date’ is closed to new replies.