【发布时间】:2017-05-09 17:14:46
【问题描述】:
我是 Woocommerce 的新手,我正在尝试在电子邮件的开头显示客户的姓名。
因此电子邮件将如下所示:
[HEADER]您的订单已下达[/HEADER]
[H2]嗨{CUSTOMER_NAME}[/H2]
[P]一些文字[/P]
[邮件的其余部分]
我已经尝试在我的主题中的 functions.php 中添加类似的内容。
//add the first name of the person to the email.
add_filter('woocommerce_email_order_details','name_to_processing_customer_email', 10, 3);
function name_to_processing_customer_email( $order, $sent_to_admin, $plain_text, $email ) {
if( 'customer_processing_order' == $email->id ){
// Set here as you want your custom content (for customers and email notification related to processing orders only)
echo '<h2>Hej '.$order->billing_first_name .'</h2>';
}
}
但这不起作用。 有人可以帮忙吗?
【问题讨论】:
标签: wordpress email woocommerce customer