Similar to "Send an Email notification to the admin for pending order status in WooCommerce" this question/answer It is the only decent answer I have found in the web about this problem, thanks to LoicTheAztec.
Now, I have a booking site where we used a WP + Woocommerce solution to sell events. Every thing is good but... If a customer makes an order and pay with bank we receive the mail order and the customer too. But if the pay with credit card (Nexi or PostFinance) non mail is sent. We used your (beautiful code) so now the customer receives two mail with bank and one with credit card. And we have some problem to receive the mail to the admin. I don't know if I made myself clear, but if you have the solution I'll be really happy and I can value to pay something for the right code to insert in function.php
We tried with this code:
// New order notification only for "Pending" Order status
add_action( 'woocommerce_checkout_order_processed', 'pending_new_order_notification', 20, 1 );
function pending_new_order_notification( $order_id ) {
// Get an instance of the WC_Order object
$order = wc_get_order( $order_id );
// Only for "pending" order status
if( ! $order->has_status( 'pending' ) ) return;
// Send "New Email" notification (to admin)
WC()->mailer()->get_emails()['WC_Email_New_Order']->trigger( $order_id );
}