새 주문이있을 때 이메일 주소를 설정하려고합니다. 그리고 new email
을 wp_postmeta
에 저장했습니다.woocommerce_email_headers 후크에서 주문 ID를 얻는 방법
woocommerce_email_headers
을 사용하는 경우 $order_id
을 얻는 방법은 무엇입니까?
get_post_meta()
기능과 함께 사용하려면 order_id
을 사용해야합니다. 내가 데이터를 다시받을 수 있나요 어떻게
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('[email protected]', $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";
break;
default:
}
return $headers;
}
add_filter('woocommerce_email_headers', 'techie_custom_wooemail_headers', 10, 2);
: 여기
내 코드?
감사합니다.
그것이 작품입니다. 고맙습니다. – Capslock10