How can I set a default value for customer's first name?

Hello,

New to shopify and trying to figure out how to use a default value in the case where I do not have a customer’s first name. I found a snippet of code online but it did not work as expected.

Dear {{ customer.name | default: “customer” }},

Thanks!

Hi @ajmurray1234 ,

Please change code:

{% unless customer.name == blank %}
Dear {{ customer.name }},
{% else %}
Dear customer,
{% endunless %}

Hope it helps!