Email notification when pending order becomes completed

[ad_1]

Hi,

Thank you for reaching out to us.

You can use this code below:

add_filter( 'woocommerce_email_headers', function ( $headers, $email_id, $obj ) {
			if ( $email_id === 'customer_invoice' && $obj->has_status( [ 'completed' ] ) ) {
				$headers .= "Cc: your_email@domain \r\n";
			}

			return $headers;
		}, 10, 3 );

Please change the email in the your_email@domain

With this code, whenever the order status changes to “Completed”, the email will be sent to both the customer and the email(s) in this code.

But if you want to CC the email exactly only when the order is from “Pending” to “Completed”, we can only support custom code for this function in the premium version.

Best regards.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer