On this page

E-mail languages

Send confirmation, sign-in link, password reset and other auth e-mails in each user's language, with ready-made translations and your own templates per language.

Auth e-mails can go out in the language of the user who receives them. Add the languages you support, edit each language’s templates or keep the ready-made ones, and every confirmation, sign-in link, password reset, invite, e-mail change and reauthentication e-mail is sent in the user’s language. Users with no language, or one you did not add, get your main language.

#Add languages

  1. Open Studio › Authentication › Emails and find Languages.
  2. Choose the main language: the one your current templates are in, and the one users get when theirs is unknown.
  3. Add more languages. English, German, French, Spanish, Italian, Portuguese and Dutch come with ready-made e-mails in the same design as the defaults; other languages start from the English text for you to translate.
  4. In E-mail templates, pick a language tab and a template to change its subject or body. Send me a test sends what is in the editor to your own address, with sample values.

Saving restarts the project’s Auth service once, which takes a few seconds. Removing a language deletes its edited templates.

#How the language is chosen

Each e-mail uses the language stored in the user’s metadata, in the first of these fields that is set: locale, language, lang. Only the first two letters count, so de, de-DE and DE all mean German.

  • The JavaScript SDK sets locale from the browser’s language when a user signs up with signUp or signInWithOtp, unless you pass one yourself.
  • The hosted sign-in page stores the language the page was shown in.
  • You can set or change it at any time; the next e-mail uses the new value.
// sign-up in a language you choose (otherwise the browser's)
await stitchdb.auth.signUp({ email, password, options: { data: { locale: 'fr' } } })

// a signed-in user switches language in your app's settings
await stitchdb.auth.updateUser({ data: { locale: 'de' } })

#Settings in the Management API

The language settings are part of the project’s Auth configuration (PATCH /projects/<ref>/config/auth in the Management API):

FieldWhat it is
email_lang_defaultThe main language, a two-letter code. Default en.
email_langsUp to 10 more languages, such as ["de", "fr"].
lang with subjects / templatesSave the subject or body of one more language: {"lang": "de", "subjects": {"recovery": "Neues Passwort"}}. An empty value goes back to the ready-made one.