User Metadata Set by Action is Not Available in First Time Passwordless Login
Last Updated:
Overview
Passwordless emails do not display text related to the metadata that is being set in Actions for a first time user.
Symptoms
Using Actions to set user metadata
Passwordless email template relies upon metadata to populate text
Applies To
- metadata
- passwordless
- first time login
- signup template missing
Cause
- See Login Flow for more details.
Solution
- The user must be created via the Management API with the relevant metadata (the /passwordless/start endpoint does not support metadata input: See Get Code or Link for more details.)
- Otherwise, the first time the email is sent, no metadata will be available for the email template.
If creating users by the Management API is impractical, the email template must have fallback values for the user's first-time login when no metadata is available.
e.g.
{{ user.user_metadata.custom_attribute_name | default: "Default value here" }}
See here for more details on liquid syntax in email templates: