I have set up the following liquid syntax if/else statement in the body of my customized welcome email template so that we can fallback to the given_name field if the email is sent before our rule to populate the custom user_metadata field is run:
{% if user.user_metadata.firstName %}
Hey {{ user.user_metadata.firstName }}, your new account awaits!
{% else %}
Hey {{ user.given_name }}, your new account awaits!
{% endif %}
When I trigger the welcome email for a user with an empty user_metadata.firstname field, but with a populated user.given_name field (“Jenna”), the value that is rendered in the sent email is an empty empty string (“Hey , your new account awaits!”).
Can someone please help me figure out the problem here? user.given_name is listed in the support documentation on fields that are available when customizing emails, and I am seeing this behavior in testing both through signing up as a new user and by triggering the email template to myself via the template’s “Try” button.