Hello @barthdesigns,
Thank you for getting back. WooCommerce is a highly customisable software with tons of actions and hooks, allowing users to add their own customisations.
In your case, we can achieve your requirement using custom coding. For example:
add_filter( 'woocommerce_allow_switching_email_locale', 'wc_child_switch_email_locale', 10, 2 );
add_filter( 'woocommerce_allow_restoring_email_locale', 'wc_child_switch_email_locale', 10, 2 );
function wc_child_get_email_locale() {
return 'en_US';
}
function wc_switch_to_admin_locale() {
global $wp_locale_switcher;
if ( function_exists( 'switch_to_locale' ) && isset( $wp_locale_switcher ) ) {
switch_to_locale( wc_child_get_email_locale() );
// Filter on plugin_locale so load_plugin_textdomain loads the correct locale.
add_filter( 'plugin_locale', 'wc_child_get_email_locale' );
// Init WC locale.
WC()->load_plugin_textdomain();
}
}
function wc_child_switch_email_locale( $switch_email_locale, $email ) {
if ( false === $email->is_customer_email() ) {
wc_switch_to_admin_locale();
} else {
wc_restore_locale();
}
return $switch_email_locale;
}
The above code should go into your child theme’s functions.php
file. Once added, the above code will set the email locale as en_US
only for admin emails. All other customer emails default to the site locale. New Order
, Failed Order
and Cancelled Order
are the only three admin emails and rest are customer emails.
I hope this helps you. Please note that the above code is only to demonstrate the customisability of WooCommerce. I request you to test it out thoroughly before using it in production.
Please do not hesitate to try out our AutomateWoo extension, which allows you to quickly build workflows without worrying about writing custom codes.