Add a message, such as next steps or a support link, to the emails customers get for processing and completed orders.
add_action( 'woocommerce_email_before_order_table', function ( WC_Order $order, bool $sent_to_admin, bool $plain_text, $email ): void {
// Only in emails to the customer for these order emails.
if ( $sent_to_admin || ! in_array( $email->id, [ 'customer_processing_order', 'customer_completed_order' ], true ) ) {
return;
}
$message = 'Questions about your order? Reply to this email and we\'ll help.';
if ( $plain_text ) {
echo esc_html( $message ) . "\n\n";
} else {
echo '<p>' . esc_html( $message ) . '</p>';
}
}, 10, 4 );
Always add PHP to a staging site first, or have FTP or file manager access ready, so you can undo it if something goes wrong.
Order emails are the most-read messages your store sends. Adding a line about delivery times, a support contact or a care guide answers questions before customers ask.
The woocommerce_email_before_order_table action runs inside every WooCommerce email that includes an order table. It passes the order, whether the email goes to the store admin, whether it’s plain text and the email object.
The snippet checks $email->id so the message only appears in the customer’s processing and completed order emails, and prints plain text or HTML to match the email format.
customer_on_hold_order, customer_invoice, customer_refunded_order and new_order (to the admin).$order->get_billing_first_name().Go to WooCommerce → Settings → Emails and open the Processing order email preview, or place a test order and check the email.