WooCommerce doesn’t automatically send the “Customer Invoice / Order Details” email when an order is placed manually and marked as “Pending.” Instead, you must manually trigger it from the order actions dropdown.
But in many use cases—especially for admin-created or offline orders you may want the pending payment invoice email to be sent automatically to the customer.
In this guide, we’ll show you how to fix that using a simple PHP snippet. This will ensure your customers always receive their payment request email, no matter how the order was created.
What Is the “Customer Invoice / Order Details” Email?
This is a WooCommerce email sent to customers when their order is marked as pending payment and needs manual action (such as a bank transfer or custom payment gateway). It’s useful when:
- You manually create orders via the admin
- You offer payment methods that don’t redirect to a gateway (like cash or offline transfers)
- You want to remind customers to complete the payment
By default, this email is not triggered automatically—but we’ll change that.
Solution: Automatically Send Invoice Email for Pending Orders
Method 1: Trigger Email on New Order Creation
This method sends the email immediately after a new order is created and is in the pending state works for orders placed via checkout or manually in the admin.
PHP Snippet
/**
* @snippet Automatically Send Woo Customer Invoice Email
* @tutorial https://yourwebsite.com
* @author Your Name
* @compatible WooCommerce 9.x
*/
add_action( 'woocommerce_new_order', 'auto_send_pending_order_email', 9999, 2 );
function auto_send_pending_order_email( $order_id, $order ) {
if ( ! $order instanceof WC_Order ) {
$order = wc_get_order( $order_id );
}
if ( 'pending' !== $order->get_status() || ! $order->needs_payment() ) {
return;
}
WC()->payment_gateways(); // Load gateways
WC()->shipping(); // Load shipping
WC()->mailer()->customer_invoice( $order ); // Send the invoice email
$order->add_order_note( __( 'Payment request automatically sent to customer.', 'your-textdomain' ), false, true );
}
Where to add this code:
You can add this snippet to your theme’s functions.php
file or in a custom plugin.
Alternative Method: Trigger on Status Change to “Pending”
If you want to send the email whenever an order is updated to “pending”, use this variation instead.
Legacy PHP Snippet
/**
* @snippet Send Invoice on Order Status Change to Pending
* @tutorial https://yourwebsite.com
* @author Your Name
* @compatible WooCommerce 9.x
*/
add_action( 'woocommerce_order_status_pending', 'auto_send_pending_order_email', 9999, 2 );
function auto_send_pending_order_email( $order_id, $order ) {
if ( ! $order->needs_payment() ) return;
WC()->payment_gateways();
WC()->shipping();
WC()->mailer()->customer_invoice( $order );
$order->add_order_note( __( 'Payment request automatically sent to customer.', 'your-textdomain' ), false, true );
}
How It Works
woocommerce_new_order
orwoocommerce_order_status_pending
hook is used to detect new or updated pending orders.$order->needs_payment()
ensures the email is only sent when the order actually requires a payment.WC()->mailer()->customer_invoice( $order )
triggers the email.- A note is added to the order timeline for tracking.
Testing the Snippet
- Create a new order manually from WooCommerce admin.
- Set the status to Pending payment.
- Click Save.
- Check the customer’s email inbox and confirm the invoice email is received.
Final Thoughts
This customization is a lifesaver when working with manual orders or custom workflows in WooCommerce. By automating the sending of the “Customer Invoice / Order Details” email, you eliminate the need to manually remind customers to complete payment and streamline your order processing.
If you use custom order workflows, this snippet ensures customers don’t miss a payment step.