Add Custom Field [Email adress] for second recipient invoice
-
Hi,
Great plugin, thanks!
I created a custom field for a second customer email adress. Now I need that second email adress to also receive the invoice as well as the standard customer email adress.
I found this code but get a fatal error (might conflict with another plugin):
add_filter( 'woocommerce_email_headers', 'wcpdf_email_cc_alternative', 10, 3); function wcpdf_email_cc_alternative( $headers, $email_id, $order ) { if ($email_id == 'customer_completed_order') { $alternative_email = get_post_meta( $order->id, '_alternative_email_field', true) if ( $alternative_email ) { $headers .= 'CC: ' . $alternative_email . "\r\n"; //just repeat this line again to insert another email address in BCC } } return $headers; }
Does this code needs to be updated? Or it it still the right way?
FYI I changed “_alternative_email_field” with my custom field name.Thanks in advance
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Add Custom Field [Email adress] for second recipient invoice’ is closed to new replies.