所以我想在 WooCommerce 中发送标题略有不同的同一封电子邮件。它使用参数$email_heading
变量来保存当前电子邮件标题的值,所以我认为一个简单的替换会起作用。它没有。我可能会完全错过这里的标记,非常感谢任何帮助。
我想说当他们选择本地取货时,您的订单已准备好取货,然后在选择任何其他运输时默认值(存储 woocommerce 的电子邮件设置)。
add_filter( "woocommerce_email_heading_customer_completed_order", 'HDM_woocommerce_email_header', 10, 2 );
function HDM_woocommerce_email_header( $email_heading, $email ) {
if ('customer_completed_order' == $email->id && $order->has_shipping_method('local_pickup') ){
$order_id = $order->get_id();
$email_heading = '<h1>Your Order Is Ready For Pickup</h1>';
}
return $email_heading;
};