我有新订单时尝试设置电子邮件地址。然后将储存在new email中wp_postmeta。
$order_id使用时如何获得woocommerce_email_headers?
我需要order_id使用它与get_post_meta()功能。
这是我的代码:
function techie_custom_wooemail_headers( $headers, $object) {
$email = get_post_meta( $order_id, '_approver_email', true );
// Replace the emails below to your desire email
$emails = array('eee@hotmail.com', $email);
switch($object) {
case 'new_order':
$headers .= 'Bcc: ' . implode(',', $emails) . "\r\n";
break;
case 'customer_processing_order':
$headers .= 'Bcc: ' . implode(',', $emails) . "\r\n";
break;
case 'customer_completed_order':
case 'customer_invoice':
$headers .= 'Bcc: ' . implode(',', $emails) . "\r\n"; …Run Code Online (Sandbox Code Playgroud)