WordPress版本:5.2.2
WooCommerce版本:3.7.0
发送静态收件人(覆盖默认值)
add_filter( \'woocommerce_email_headers\', \'hasan_headers_filter_function\', 10, 2);
function hasan_headers_filter_function( $headers, $object ) {
$headers = \'Test Dealer <[email protected]>\';
return $headers;
}
将额外的静态收件人与管理员一起发送
add_filter( \'woocommerce_email_headers\', \'hasan_headers_filter_function\', 10, 2);
function hasan_headers_filter_function( $headers, $object ) {
$headers .= \'CC: Test Dealer <[email protected]>\' . "\\r\\n";
return $headers;
}
如果您只想在订单完成时发送
add_filter( \'woocommerce_email_headers\', \'hasan_headers_filter_function\', 10, 2);
function hasan_headers_filter_function( $headers, $object ) {
if ($object == \'customer_completed_order\') {
$headers .= \'CC: Test Dealer <[email protected]>\' . "\\r\\n";
}
return $headers;
}