【发布时间】:2018-11-07 03:24:05
【问题描述】:
我正在尝试在“订单完成”电子邮件中显示一些“有条件的”自定义文本,当订单被标记为完成时发送给客户。我用过the following code。
现在,我想让这段代码有条件,所以这段代码应该只对“礼品”类别的产品有效。我找不到任何适合此特定功能的 Woocommerce 功能。
任何帮助将不胜感激。
这是我现在拥有的:
add_action( 'woocommerce_email_before_order_table',
'bbloomer_add_content_specific_email', 20, 4 );
function bbloomer_add_content_specific_email( $order, $sent_to_admin, $plain_text, $email ) {
if ( $email->id == 'customer_completed_order' ) {
echo '<p class="email-text-conditional">Thank you for your order with Adventure Clues, we have sent your recipient the gift card’</p>';
}
}
【问题讨论】:
标签: php wordpress woocommerce custom-taxonomy email-notifications