Custom email field code not working.
-
Hi I found this code in a previous tread, as I also need to set a custom email field to send a new order email notification to, but the code is not working. It tells me theres an error in the 4th last line: $emails .= ‘,’.$aditional_email;
Can anyone tell me what is wrong?add_filter(‘woocommerce_email_recipient_new_order’, ‘additional_email_checkout’, 10, 2);
function additional_email_checkout($emails, $object){
$aditional_email = get_post_meta($object->id, ‘field_name‘, true);
if($aditional_email){
$emails .= ‘,’.$aditional_email;
}
return $emails;
}
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Custom email field code not working.’ is closed to new replies.