[英]Custom email for Woocommerce (Wordpress)
I created custom HTML template with inline styles for 'customer processing order' email notification in Woocommerce (woocommerce/templates/emails/customer-processing-order.php) and put it in my themes folder.我在 Woocommerce (woocommerce/templates/emails/customer-processing-order.php) 中为“客户处理订单”电子邮件通知创建了带有内联样式的自定义 HTML 模板,并将其放在我的主题文件夹中。
However, I am stuck in this section:但是,我被困在这一部分:
<tbody>
<?php echo $order->email_order_items_table( $order->is_download_permitted(), true, $order->has_status( 'processing' ) ); ?>
</tbody>
this echo outputs the table with data and i cannot understand where to add styles.这个回声输出带有数据的表格,我无法理解在哪里添加样式。
Please, advise请指教
You want to look at woocommerce/templates/emails/email-order-item.php
;你想看看woocommerce/templates/emails/email-order-item.php
; that's the template that outputs the table rows.那是输出表格行的模板。 As per the other template, copy it to your theme folder and then you can customise it.根据其他模板,将其复制到您的主题文件夹,然后您可以对其进行自定义。
You may want to take a look at the documentation for template overrides here .您可能需要在此处查看模板覆盖的文档。 As Dre pointed out earlier as well, woocommerce/templates/emails/email-order-item.php
can help you with this.正如 Dre 之前指出的那样, woocommerce/templates/emails/email-order-item.php
可以帮助您解决这个问题。 Be sure to point them in the right directory within your theme per the documentation.请务必根据文档将它们指向主题中的正确目录。
How to style WooCommerce Emails如何设计 WooCommerce 电子邮件的样式
The template email folder woocommerce/templates/emails/
(original plugin folder not your child theme) has a file called email-styles.php
.模板电子邮件文件夹woocommerce/templates/emails/
(原始插件文件夹不是您的子主题)有一个名为email-styles.php
的文件。 You will find all styles there to override or add new ones.您会在那里找到所有样式以覆盖或添加新样式。
In that regard I'd also suggest the plugin WooCommerce E-Mail Preview, which gives you an HTML view of the email, so you can inspect and target elements for styling.在这方面,我还建议使用插件 WooCommerce 电子邮件预览,它为您提供电子邮件的 HTML 视图,因此您可以检查和定位元素以进行样式设置。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.