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
/* キャンセル 顧客にメール送信 */ | |
add_action('woocommerce_order_status_changed', 'send_custom_email_notifications', 10, 4 ); | |
function send_custom_email_notifications( $order_id, $old_status, $new_status, $order ){ | |
if ( $new_status == 'cancelled' || $new_status == 'failed' ){ | |
$wc_emails = WC()->mailer()->get_emails(); // Get all WC_emails objects instances | |
$customer_email = $order->get_billing_email(); // The customer email | |
} | |
if ( $new_status == 'cancelled' ) { |