If you want to get customers name in confirmation email in WooCommerce? Use following code in your theme’s functions.php file OR in site specific plugin.
* Get customers name in confirmation email in WordPress.
$order = new WC_Order( $order_id );
$to = $order->billing_email;
$subject = 'this is my subject';
$message = 'Hi '.$order->billing_first_name.' '.$order->billing_email;$order->billing_last_name.', thanks for the order!';
woocommerce_mail( $to, $subject, $message, $headers = "Content-Type: text/htmlrn", $attachments = "" )
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.