我使用Woocommerce,我需要根据电子邮件的类型更改电子邮件头,以便“Custome-new-Account.php”、“order.php”、"admin-new-order.php“(等等).他们肯定有不同的标题。
我刚刚在子模板中复制了woocommerce的“电子邮件”文件夹,现在我需要知道如何进行代码更改。
任何帮助都是感激的。-)预先谢谢。
发布于 2015-10-27 03:05:04
我可以使用条件头使用did_action
函数的email-header.php文件,以检查哪种类型的电子邮件被触发。
您可以检查其类构造函数上的每封电子邮件的操作。每封电子邮件在woocommerce/includes/ email /文件夹(即woocommerce/includes/emails/class-wc-email-customer-note.php )上都有自己的类文件。在检查未由add_action
触发的发票电子邮件和新用户电子邮件时,可以检查$order
和$user_login
变量:
if ( 0 < did_action('woocommerce_order_status_pending_to_processing_notification') || 0 >= did_action('woocommerce_order_status_pending_to_on-hold_notification') ) {
// your specific code for this case here;
}
else if ( 0 < did_action('woocommerce_new_customer_note_notification') ) {
// your specific code for this case here;
}
else if ( $order ) {
echo '<p>aajast_woo_mail 7 = invoice + customer-invoice; </p>';
}
else if ( $user_login ) {
// your specific code for this case here;
};
https://stackoverflow.com/questions/27400044
复制相似问题