Customize SMS and Voice Messages

You can customize SMS and voice messages sent by Auth0 during enrollment (when associating a device to Guardian) and verification (when an authentication message is sent to the device):

  1. Go to Dashboard > Security > Multi-factor Auth, and click Phone Message.

  2. Customize your message templates, and click Save.

Dashboard - Security - Multifactor Auth - Phone Message - Templates

You can customize templates for two message types:

  • Enrollment: Message sent by Auth0 during device enrollment.

  • Verification: Message sent by Auth0 to verify the possession of the device.

Syntax

Liquid syntax is the supported templating engine you use when accessing user attributes in SMS templates. The following attributes are available:

Attribute Description
message_type Indicates which kind of message is sent; sms or voice.
code Enrollment/verification code. When sending voice messages. Variable values are separated by dots between the digits (1.2.3.4.5) so it can be pronounced accurately by voice messaging providers.
locale For New Universal Login or MFA API. Designates the language.
requestInfo.lang For Classic Universal Login localization. Browser accept-language header. For example: es-AR,es;q=8.0, en-US,en.
tenant.friendlyName The Friendly Name set in Dashboard > Tenant Settings.

Example

{% if message_type == "voice" %}
  {% if locale contains "fr" %}
  Bonjour, vous avez demandé à recevoir un code de vérification pour vous enregister avec {{tenant.friendly_name}}. Votre code est: {{pause}} {{code}}. Je répète, votre code est: {{pause}}{{code}}.
  {% elsif locale contains "es" %}
  Usted ha requerido un código de verificación para inscribirse con {{tenant.friendly_name}}. Su código es: {{pause}}{{code}}. Repito, su código es: {{pause}}{{code}}.
  {% else %}
  Hello, you requested a verification code to enroll with {{tenant.friendly_name}}. Your code is: {{pause}}{{code}}. I repeat, your code is: {{pause}}{{code}}.
  {% endif %}
{% else %}
  {% if locale contains "fr" %}
  {{code}} est votre code de vérification pour vous enregistrer avec {{tenant.friendly_name}}.
  {% elsif locale contains "es" %}
  {{code}} es su código para inscribirse con {{tenant.friendly_name}}.
  {% else %}
  {{code}} is your verification code to enroll with {{tenant.friendly_name}}.
  {% endif %}
{% endif %}

Localization

The endpoints support the x-request-language header and you can use it to send the locale. See Multi-Language Support for details.

This is also supported in the MFA API (POST /mfa/associate and POST /mfa/challenge endpoints). When it's sent, that locale will be available in the locale variable in the MFA SMS/voice template.

You must also select those languages in Tenant > Settings (under Supported Languages) for this to work.

Learn more