I am trying to change the sender email for all emails related to two products in WooCommerce, but not for all the others.
I have the code below to change the sender email, but I am not sure how to make it work for only those two products (by product id or category).
function change_sender_email( $original_email_address ) {
return 'admin@example.com';
}
add_filter( 'wp_mail_from', 'change_sender_email' );
Could I somehow use the filter 'woocommerce_email_recipient_customer_completed_order
'?
I know how to use that to conditionally change the recipient of the email, but I couldn't get it to work to change the sender email.