我对WordPress非常陌生,并创建了一个使用WooCommerce的电子商务商店。在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;
}
中的代码片段工作正常,并只显示给客户,而不是我。例如“谢谢你的订单ABCD衣服订购约翰!”。 在电子邮件的正文中,我试图让这个个人作为一个小感谢你的消息,但是,当我做了消息,我现在用的钩:
add_action('woocommerce_email_before_order_table', 'custom_add_content', 20,1);
我知道,因为即时通讯使用woocommerce_email_before_order_table
挂钩,自定义功能将发送到客户和我自己的电子邮件正文中。
我在想,Woocommerce是否提供了一个钩子,以便自定义函数只会发送给电子邮件正文中的客户?
例如:woocommerce_email_header_customer_processing_order
或单词是否有这种效果?
感谢
辉煌,谢谢你的工作。出于好奇,当仅使用$ email时,将这4个参数包含在函数中的目的是什么? –
由于'$ email'是第四个也是最后一个参数,所以你**不能删除其他的**,你将来可能需要添加更多的条件或基于其他参数的代码(尤其是第一个)...最重要的是,这是为你工作,还是不是? – LoicTheAztec