/*
* Let's add some more information to the customer details block in admin emails
* This particular example adds the billing country
*/
function mysite_filter_woocommerce_email_customer_details_fields( $fields, $sent_to_admin, $order ) {
if ( $order->billing_country ) {
$fields['billing_country'] = array(
'label' => __( 'Country', 'woocommerce' ),
'value' => WC()->countries->countries[ $order->billing_country ],
);
}
return $fields;
};
// add the filter
add_filter( 'woocommerce_email_customer_details_fields', 'mysite_filter_woocommerce_email_customer_details_fields', 10, 3 );