Display custom order meta data value in email notifications WooCommerce

You have some minor mistakes, via the if condition “$email->id == …” you can target the mails How to target other WooCommerce order emails ‘customer_completed_order’ ‘customer_processing_order’ ‘customer_on_hold_order’ ‘customer_refunded_order’ ‘customer_reset_password’ ‘customer_invoice’ ‘customer_new_account’ ‘customer_note’ ‘cancelled_order’ ‘failed_order’ ‘new_order’ function woocommerce_email_order_invoice_number( $order, $sent_to_admin, $plain_text, $email ) { // For ‘new order’ if ( $email->id == ‘new_order’ ) { // … Read more

Send an Email notification to the admin for pending order status in WooCommerce

UPDATE 2 (Change from woocommerce_new_order to woocommerce_checkout_order_processed thanks to Céline Garel) This code will be fired in all possible cases when a new order get a pending status and will trigger automatically a “New Order” email notification: // 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 … Read more

Allow re-sending New Order Notification in WooCommerce 5+

Since WooCommerce 5.0 a new filter hook has been added, that disables resending “New Order” email notification, restricting this specific notification to be sent only one time. This is what has been added to WC_Email_New_Order trigger() method (default is set to false): /** * Controls if new order emails can be resend multiple times. * … Read more