How to localize Change Password (Link) email template (React Native SDK / dbconnections/change_password)?

I’m trying to add multilingual support (English + Dutch) to the Change Password (Link) email template in Auth0.

My client app (React Native) calls resetPassword using the SDK:

await auth0.auth.resetPassword({
  email,
  connection: "Username-Password-Authentication",
});

Which under the hood calls /dbconnections/change_password (docs)

The email template is customized in Branding → Email Templates → Change Password (Link) (docs, docs 2).

Auth0 docs suggest we can use request_language in templates to switch content:

{% assign language = request_language | slice: 0,2 %}
{% if language == "nl" %}
  Wachtwoord opnieuw instellen
{% else %}
  Reset Password
{% endif %}

I tried sending headers like X-Request-Language / Accept-Language from the SDK call, but when I debugged with {% debug %} in the template, request_language was not present. The context only included user, application, url, etc., but no request_language.

Right now the only suggestion I’ve seen is to use user_metadata.lang in the template. But I don’t have any appropriate flow where I can capture and persist the user’s language. It should not be the only option to get the user’s language for these emails.

So my questions are:

  1. Does request_language actually work for the Change Password (Link) template when triggered via /dbconnections/change_password? Or is it only supported for other email types (e.g. Passwordless, Blocked Account, etc.)?
  2. Is there a way to pass a language parameter in the reset password request that flows into the email template?
  3. If not, what’s the recommended approach to localise reset password emails without relying on user_metadata.lang?

If possible, I’d like to keep the Auth0 flow for sending the reset emails, but right now, I can’t get the language context into the template.

1. Does request_language work for Change Password emails?

No, request_language does NOT work for the Change Password (Link) template when triggered via /dbconnections/change_password. This is a known limitation. The request_language variable is primarily supported for:

  • Passwordless email templates
  • Some verification emails
  • Welcome emails in certain flows

But not for password reset emails triggered through the Management API or /dbconnections/change_password endpoint.

2. Can you pass language parameters in the reset password request?

Unfortunately, no. The /dbconnections/change_password endpoint and the SDK’s resetPassword method don’t accept language parameters that flow into the email template context. The headers you tried (X-Request-Language, Accept-Language) are not processed by Auth0 for this specific flow.

3. Recommended approaches without user_metadata.lang

Here are your viable options, ranked by practicality:

Option 1: Use Application Metadata (Recommended)

If your app serves a specific language market, you can use the application context:

liquid

{% assign app_name = application.name | downcase %}
{% if app_name contains 'dutch' or app_name contains 'nl' %}
  <h1>Wachtwoord opnieuw instellen</h1>
  <p>Klik op de onderstaande link om uw wachtwoord opnieuw in te stellen:</p>
{% else %}
  <h1>Reset Password</h1>
  <p>Click the link below to reset your password:</p>
{% endif %}

Or use application metadata if you configure it:

liquid

{% if application.metadata.default_language == 'nl' %}
  <h1>Wachtwoord opnieuw instellen</h1>
{% else %}
  <h1>Reset Password</h1>
{% endif %}

Option 2: User Email Domain Detection

Use the user’s email domain to infer language:

liquid

{% assign email_domain = user.email | split: '@' | last %}
{% if email_domain contains '.nl' or email_domain == 'company.nl' %}
  <h1>Wachtwoord opnieuw instellen</h1>
{% else %}
  <h1>Reset Password</h1>
{% endif %}

Option 3: Custom Email Provider (Most Flexible)

Switch to a custom email provider where you have full control:

  1. Configure a custom email provider (SendGrid, Mailgun, etc.)
  2. Create an Auth0 Action that triggers on password reset
  3. Send custom emails with full language support

Example Action:

javascript

exports.onExecutePostChangePassword = async (event, api) => {
  const { user, request } = event;
  
  // You can capture language from custom claims or other sources
  const language = user.app_metadata?.language || 'en';
  
  // Send custom email via your provider
  await sendCustomPasswordResetEmail(user.email, language);
  
  // Optionally suppress Auth0's default email
  // (This requires configuration changes)
};

Option 4: Multiple Applications Approach

Create separate Auth0 applications for different languages:

  • myapp-en for English users
  • myapp-nl for Dutch users

Then use application-specific templates or route users to the appropriate application based on their language preference.

Option 5: Workaround with User Metadata

If you can capture language during any user interaction (login, signup, profile update), store it in user metadata:

javascript

// During any authenticated flow
await auth0.users.updateUserMetadata(user.sub, {
  language: 'nl'
});

Then use in template:

liquid

{% if user.user_metadata.language == 'nl' %}
  <h1>Wachtwoord opnieuw instellen</h1>
{% else %}
  <h1>Reset Password</h1>
{% endif %}

Alternative: Geographic Detection

You could also use a hybrid approach with JavaScript in your email template (though limited):

liquid

<script>
  // Basic geographic/browser language detection
  const browserLang = navigator.language || navigator.userLanguage;
  const isNL = browserLang.startsWith('nl');
  
  if (isNL) {
    document.querySelector('.email-content').innerHTML = `
      <h1>Wachtwoord opnieuw instellen</h1>
      <p>Klik op de onderstaande link om uw wachtwoord opnieuw in te stellen:</p>
    `;
  }
</script>
1 Like

Hi everyone!

Thank you @sumansaurav for providing such a comprehensive guide regarding the matter at hand!

As they have advised, the options above would be suitable alternatives regarding implementing localization for the Change Password (Link) template.

If you have any other questions regarding the matter, please feel free to let us know!

Kind Regards,
Nik