How to get the customer name in Commerce order confirmation e-mail? How can I get the customer name from the billing information variable in the commerce-order-receipt.twig.html template of the Drupal 8 Commerce order confirmation e-mail?
First, you have to create function as @NoSSweat suggested (thanks for the hint) and from it get it like:
function hook_preprocess_commerce_order_receipt(&amp;$variables)
{
  $givenName = $variables['billing_information']['#profile']-&gt;get('address')[0]-&gt;given_name;
  $variables['given_name'] = $givenName;
}

(was incredible hard to figure this out :) ) Field name for last name would be &quot;family_name&quot;. Checkout the file:
/modules/contrib/address/src/Plugin/Field/FieldType/AddressItem.php
for other available fields.
I added this function to my module, but adding it to theme file should also work.
That way you are assigning variable which is now available in twig template so you can print it simple as:
{{ given_name }}

Don't forget to clear the cache.