Last active
July 14, 2023 12:28
-
-
Save kartikparmar/18a4d11480f95daf539a187aa4d8ae5e to your computer and use it in GitHub Desktop.
Vendor confirmed booking
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function vendor_init_emails( $email ) { | |
if ( ! isset( $emails['RSA_Email_Booking_Confirmed_Vendor'] ) ) { | |
$emails['RSA_Email_Booking_Confirmed_Vendor'] = include_once BKAP_PLUGIN_PATH . '/emails/vendor-booking-confirmed.php'; // this will be the patch where your file is located. | |
} | |
return $emails; | |
} | |
add_filter( 'woocommerce_email_classes', 'vendor_init_emails', 10, 1 ); | |
function vendor_booking_is_confirmed( $booking_id ) { | |
$booking = new BKAP_Booking( $booking_id ); | |
$item_id = $booking->get_item_id(); | |
$wc_email = WC_Emails::instance(); | |
$email = $wc_email->emails['RSA_Email_Booking_Confirmed_Vendor']; | |
$email->trigger( $item_id ); | |
} | |
add_action( 'bkap_booking_is_confirmed', 'vendor_booking_is_confirmed', 10, 1 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment