Skip Navigation
availability:

WooCommerce Multilingual Version: 4.7.0

description:

Use this filter to set the language of the email sent to the administrator when a new order is placed or the status of an existing one changes.

type:
filter
category:
Miscellaneous
parameters:
apply_filters( 'wcml_new_order_admin_email_language', $admin_language, $recipient, $order_id )

There are three parameters being passed to this filter:

$admin_language
(string) The admin user language.
$recipient
(string) The admin user email.
$order_id
(integer) The order ID.
  • admin user language
  • $recipient admin user email
  • order id
hook example usage:

Example

add_filter( 'wcml_new_order_admin_email_language', 'use_order_language_for_new_order_admin_email', 10, 3 );

function use_order_language_for_new_order_admin_email( $admin_language, $recipient, $order_id ){
    $order_language = get_post_meta( $order_id, 'wpml_language', true );

    return $order_language ? $order_language : $admin_language;
}