We have added an email attribute to our database connection. In that attribute we enabled One-Time Password (OTP) and we also changed to Identifier-First login.
But no email are being sent, but if we enable the template for “Verification Email (code)” under Branding → Email Templates, we do get the email.
Does not specify the template as a requirement, is there no default being used?
When enabling templates, we have no control over the language. We thought if we disable the template, a default one (based on ui_locales
) would be used (ie the language which the registration process started with).
Hi @gustav.elmgren
Thank you for reaching out!
Let me try and provide some insight into this matter; you are correct, Email Template will need to be enabled in this case for the email to be delivered. At this moment, there isn’t a standard template that gets sent without enabling ( and possibly customizing ) the particular one needed, in this case Verification Email ( code ). Testing this on my end yields the same result as you encountered.
To overcome the language issue, please look over this Knowledge Article that provides a workaround to adapt the email templates according to the user’s language.
Other useful articles on this topic :
Hope this helped!
Gerald
I have attempted to retrieve request_language
and user_metadata.lang
to control the language, but without success. Additionally, I have tried using a “pre-user-registration” action to set the user’s language preference, but this action is triggered only after the user has received the OTP email and entered their code.
The user object contains the following when I debugged the email:
"user": {
"email": "john@doe.com",
"logins_count": 0
},
In the article you linked, they are using:
{% if user.user_metadata.lang == 'es' %}
But as you can see, it’s missing when I debug it.