Skip to content
Advertisement

Edit header and footer only for “customer-on-hold-order” email notifications in WooCommerce

I tried to edit the header and footer of emails of my store, but I’m only able to edit if it goes directly to the template of ALL emails.

I also tried to copy the email-header.php and email-footer.php to my child theme and nothing happens.

Since that the template customer-on-holder-order have listed the code

JavaScript

How can I find/edit this? Any advice?

Advertisement

Answer

It is correct that the woocommerce_email_header and the woocommerce_email_footer action hook occur in multiple template files.

However, to target a specific email you can use $email->id, since $email is passed to both hooks as an argument

So you get:

JavaScript

Code goes in functions.php file of the active child theme (or active theme). Tested and works in WordPress 5.8.1 & WooCommerce 5.8.0

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement