自定义 WooCommerce 订单电子邮件 [英] Customize WooCommerce order email

查看:58
本文介绍了自定义 WooCommerce 订单电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的网站使用 WooCommerce.我需要更改已取消订单"中的电子邮件正文.我想在电子邮件正文中添加我自己的内容,仪表板中没有编辑正文的选项.是否有任何挂钩可以更改电子邮件正文?

I'm using WooCommerce for my website. I need to change the body of the email in 'Cancelled order'. I want to add my own content in the email body, There is no option to edit the body in the dashboard. Are there any hooks to change the email body?

推荐答案

您需要覆盖已取消订单的电子邮件模板.

You need to override Cancelled order email template.

要覆盖和编辑此电子邮件模板副本:
woocommerce/templates/emails/admin-cancelled-order.php 到您的主题文件夹:yourtheme/woocommerce/emails/admin-cancelled-order.php.
现在编辑此文件以更改简单的表头更改.

To override and edit this email template copy :
woocommerce/templates/emails/admin-cancelled-order.php to your theme folder: yourtheme/woocommerce/emails/admin-cancelled-order.php.
Now edit this file to change simple table header changes.

如果您需要更改表格正文内容,则需要将:
woocommerce/templates/emails/email-order-items.php 复制到您的主题文件夹:yourtheme/woocommerce/emails/email-order-items.php,因为从 admin-cancelled-order.php 文件表体,这个函数
<?php echo $order->email_order_items_table( false, true );?>
被调用,它依次调用模板 email-order-items.php.

If you need to change table body content then you need to copy:
woocommerce/templates/emails/email-order-items.php to your theme folder: yourtheme/woocommerce/emails/email-order-items.php, because from admin-cancelled-order.php file table body, this function
<?php echo $order->email_order_items_table( false, true ); ?>
is called which in turns calls the template email-order-items.php.

这篇关于自定义 WooCommerce 订单电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆