The linked related code that you are using, still works perfectly in WooCommerce 7.8+, without throwing any errors...
As the custom order status uses WC_Email_Customer_Processing_Order
email type, the required email ID will be customer_processing_order
.
The code below will allow adding a CC email for "Shipped" custom order status email notification:
add_filter( 'woocommerce_email_headers', 'custom_cc_email_headers_shipped_order', 10, 3 );
function custom_cc_email_headers_shipped_order( $header, $email_id, $order ) {
// Only for "Customer Processing Order" email and "Shipped" order status
if( 'customer_processing_order' === $email_id && $order->has_status( 'shipped' ) ) {
$email = 'some.user@gmail.com'; // Her set the email address
// Add email address as Cc to headers
$header .= 'Cc: '.$email .'\r\n';
}
return $header;
}
Code goes in functions.php file of your active child theme (or active theme). Tested and works.