【发布时间】:2017-05-19 08:37:53
【问题描述】:
我对 WordPress 非常陌生,并且使用 WooCommerce 创建了一个电子商务商店。
客户下订单后,我会收到一封电子邮件,客户也会收到一封电子邮件 - 一封让我说出他们订购的内容,另一封作为感谢电子邮件发给他们。
在这封感谢邮件中,在我的 functions.php 文件中,我学会了更改标题的主题以包含他们的名字,例如:
//add the first name of the person to the person getting the reciept in the subject of the email.
add_filter('woocommerce_email_subject_customer_processing_order','UEBC_change_processing_email_subject', 10, 2);
function UEBC_change_processing_email_subject( $subject, $order ) {
global $woocommerce;
$subject = 'Thanks for your ' . get_bloginfo( 'name', 'display' ) . ' Order, '.$order->billing_first_name .'!';
return $subject;
}
上面的代码 sn-p 可以正常工作,并且只显示给客户,而不显示给我。例如“感谢您订购 ABCD Clothes 订购 John!”。 在电子邮件的正文中,我试图将此作为个人的感谢信息,但是,当我发送信息时,我使用的是钩子:
add_action( 'woocommerce_email_before_order_table', 'custom_add_content', 20,1 );
我知道,由于我使用了woocommerce_email_before_order_table 钩子,自定义函数将在电子邮件正文中发送给客户和我自己。
我想知道,Woocommerce 是否提供了一个挂钩,以便仅在电子邮件正文中将自定义功能发送给客户?
例如:woocommerce_email_header_customer_processing_order 或类似的词?
谢谢
【问题讨论】:
标签: php wordpress woocommerce orders email-notifications