How can I change E-Mail Sender Name into customer “Billing First & Last Name” using woocommerce_email_from_name
hook?
For Example: "My Shop" should be changed to "John Doe".
Based on Change sender name and email address for specific WooCommerce email notifications answer code, here is my function:
add_filter( ‘woocommerce_email_from_name’, function( $from_name, $wc_email ){
if( $wc_email->id == ‘customer_processing_order’ )
// $from_name = ‘Jack the Ripper’;
$from_name = get_user_meta( $user_id, ‘first_name’, true, $user_id, ‘last_name’, true );
//$from_name = get_user_meta( $user_id, ‘first_name’, true );
return $from_name;
}, 10, 2 );
ut it doesn't work. Can anyone help me?