How to change the language in the passwordless email?

I have a react-native application that uses passwordless login i.e. login using a magic link sent via email.

I’d like to send users from a certain country the email in a certain language based on their IP address. I know that auth0 provides this (event.request.geoip.countryCode).

The react-native application uses the ‘react-native-auth0’ library, specifically the passwordlessWithEmail api to send the email.

I’ve tried using a custom action (i.e. Actions > Flows) to send an HTTP request to the /passwordless/start endpoint with the x-request-language headers.

This works as expected, however, since the app already calls the passwordlessWithEmail api, the user ends up getting 2 separate emails, in 2 separate languages.

My questions are:

  • Is there a way to only use the custom action to send the email and not have the passwordlessWithEmail api send an email at all?

How would you go about achieving this? i.e. send a magic link (passwordless login) in a different language? I also explored setting the user metadata, but this is not set until the user is registered (i.e. after the passwordless magic link is sent).

Thanks so much for your help.