Change sender name and email address for specific WooCommerce email notifications

The sender name and email address are set here (at the end of Woocommerce “Emails” setting tab: This fields are passed through dedicated filters hook that allow you to change conditionally the values. Here is an example conditionally restricted to “customer processing email notification”: // Change sender name add_filter( ‘woocommerce_email_from_name’, function( $from_name, $wc_email ){ if( … 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

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

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