OTP - Email verification not being sent?

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.