On the woocommerce thank you page I want if the order status is processing then send WC_Email_Customer_Invoice email to multiple email addresses.
add_action( 'woocommerce_thankyou', 'dvs_add_more_recipient' );
function dvs_add_more_recipient($order_id) {
$order = new WC_Order($order_id);
if( ! $order->has_status( 'processing' ) ) return;
$wc_email = WC()->mailer()->get_emails()['WC_Email_Customer_Invoice'];
$wc_email->settings['recipient'] .= ',prohostreview@gmail.com';
$wc_email->trigger( $order_id );
}
But the issue is email only sent to the customer's email address and there is no email sent to prohostreview@gmail.com. I am using the latest WordPress and woo-commerce plugin.
Please tell me what I did wrong here.
Regards.