Customer First Name on Subject Section

fsebastiao
New Member
1 0 0

I'm trying to use customer.first_name on the Subject section but I couldn't find a way to do it. You guys can help me out on that? Thanks

0 Likes
Michal_Morek
Shopify Partner
819 71 134

Hi @fsebastiao 

Hope you're having a great day!

As specified here by Shopify:

The customer object is global in the sense that you can access it in all layout, template, and snippet files. However, the object is only defined when a customer is logged in.

{% if shop.customer_accounts_enabled %}
  {% if customer %}
    Customer is logged in. You can access the customer attributes such as {{ customer.first_name }}.
  {% else %}
    {{ 'Log in' | customer_login_link }}
    {% if shop.customer_accounts_optional %}
      {{ 'Create an account' | customer_register_link }}
    {% endif %}
  {% endif %}
{% endif %}

If you found this comment useful, hit the 'Like' and 'Accepted solution' buttons.

Founder of Shopify agency - Accomplishify.com
If you would like to hire us as Shopify experts, please reach out via:
  • Email michal.morek@accomplishify.com
  • WhatsApp +48 507 613 425
0 Likes