Php WooCommerce:仅为一封电子邮件触发电子邮件
是否可以仅为一个收件人触发来自Woo的完整电子邮件? 谢谢Php WooCommerce:仅为一封电子邮件触发电子邮件,php,wordpress,email,woocommerce,hook-woocommerce,Php,Wordpress,Email,Woocommerce,Hook Woocommerce,是否可以仅为一个收件人触发来自Woo的完整电子邮件? 谢谢 add_action( 'woocommerce_order_status_partial-shipped', 'partial_shipped_trigger_on_custom_email_notification', 20, 2 ); function partial_shipped_trigger_on_custom_email_notification( $order_id, $order ) { // Get W
add_action( 'woocommerce_order_status_partial-shipped', 'partial_shipped_trigger_on_custom_email_notification', 20, 2 );
function partial_shipped_trigger_on_custom_email_notification( $order_id, $order ) {
// Get WooCommerce email objects
$recipient = 'test@gmail.com';
$mailer = WC()->mailer()->get_emails();
// $wc_emails = WC()->mailer();
$mailer['WC_Email_Customer_Completed_Order']->recipient = $recipient;
$mailer['WC_Email_Customer_Completed_Order']->settings['recipient'] = $recipient;
// Send the email with custom heading & subject
$mailer['WC_Email_Customer_Completed_Order']->trigger( $order_id );
}