WooCommerce provides several hooks that allow you to customize email notifications sent to customers and administrators. After some digging I list here some of the most commonly used email-related hooks in WooCommerce:
- Email Header and Footer Hooks:
woocommerce_email_header
: Used to output the email header HTML.woocommerce_email_footer
: Used to output the email footer HTML.
- Individual Email Content Hooks:
woocommerce_email_before_order_table
: Used to output content before the order table in emails.woocommerce_email_after_order_table
: Used to output content after the order table in emails.woocommerce_email_order_meta
: Used to output order meta data in emails.woocommerce_email_customer_details
: Used to output customer details in emails.woocommerce_email_order_details
: Used to output the order details in emails.
- Email Sending Hooks:
woocommerce_email_recipient_{$email_class}
: Used to modify the email recipients.woocommerce_email_subject_{$email_class}
: Used to modify the email subject.woocommerce_email_headers
: Used to modify email headers.woocommerce_email_attachments
: Used to add attachments to emails.
- Customization and Filtering Hooks:
woocommerce_email_content_type
: Used to modify the email content type (e.g., HTML or plain text).woocommerce_email_formatting
: Used to modify the email formatting.woocommerce_email_classes
: Used to add or modify email classes.
These hooks allow you to customize various aspects of the WooCommerce email system, such as the content, appearance, recipients, and more. You can use them in your theme’s functions.php
file or in a custom plugin to add your customizations.