I am looking to send all emails to another email in order to parse them (using Sendgrid inbound parse).
This is what I currently have:
function custom_add_email_address_to_emails( $headers, $object ) {
$additional_email = '[email protected]';
$headers .= 'Cc: ' . $additional_email . "\r\n";
return $headers;
}
add_filter( 'woocommerce_email_headers', 'custom_add_email_address_to_emails', 10, 2 );
CC-ing, unfortunately, doesn’t seem to work for inbound parse, so I need to actually add the email as a recipient. Do you know how I might do this?
You can add recipients to WooCommerce pre-defined email notifications using the composite hook
woocommerce_email_recipient_{$email_id}.In the code below:
The code:
Code goes in functions.php file of your child theme (or in a plugin). Tested and works.
Related: Target a specific email notification with the email id in WooCommerce