Adding an audit trail to WooCommerce completed orders emails is a fairly easy task. We can achieve this by employing the filter woocommerce_email_headers and adding in a check for the object name customer_completed_order. ** This will work for WooCommerce version less than or equal to 2.2 **
1 2 3 4 5 6 7 8 9 10 11 12 13 |
/** * BCC Email for orders completed for WooCommerce version 2.2 and below */ add_filter( 'woocommerce_email_headers', 'mycustom_headers_filter_function', 10, 2); function mycustom_headers_filter_function( $headers, $object ) { if ($object == 'customer_completed_order') { $headers .= 'BCC: Sales <contact@eversionsystems.com>' . "\r\n"; } return $headers; } |
** For WooCommerce version 2.3 and above […]