How to add customer's first name as variable in email template?

How do I add the customer’s first name only to email template.
{{ recipient.name }} adds the customer’s full name.
I’ve also tried {{ recipient.name | truncatewords: 1, “” }} with no success.
I would like to have:

Hi {{recipient.first_name}},

Attached is invoice {{reference}}.

Is this currently possible?

Thanks

This is not possible. {{ recipient.name }} is a single string and will return whatever you have entered into that field when defining the customer. If you want only first names, you will have to enter only first names. But, of course, it won’t do to send an invoice to “Judy.”

Ok. Thanks for the reply. Hopefully this will be possible sometime in the future.

try

{% assign names = recipient.name | split: " " %}
{{ names.first }}

2 Likes

Thank you so much @isklerius! It works and you are a legend!