Skip to content

Instantly share code, notes, and snippets.

@kartikparmar
Last active July 14, 2023 12:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kartikparmar/18a4d11480f95daf539a187aa4d8ae5e to your computer and use it in GitHub Desktop.
Save kartikparmar/18a4d11480f95daf539a187aa4d8ae5e to your computer and use it in GitHub Desktop.
Vendor confirmed booking
<?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