0

In WooCommerce, when a customer submits the order, the order can be set to "processing" payment. Or "on hold". The Admin doesn't receive any email about it.

I would like to send an email to Admin for this kind of order. How can I do it?

Tryed this code (for "Processing" status):

// New order notification only for "Process" Order status
add_action( 'woocommerce_checkout_order_processed', 'process_new_order_notification', 20, 1 );
function process_new_order_notification( $order_id ) {

    // Get an instance of the WC_Order object
    $order = wc_get_order( $order_id );

    // Only for "Process" order status
    if( ! $order->has_status( 'process' ) ) return;

    // Send "New Email" notification (to admin)
    WC()->mailer()->get_emails()['WC_Email_New_Order']->trigger( $order_id );
}

But something is wrong and still no email

Help, please.

0 Answers0