Skip to main content

Configure SMS message templates

Customize the text messages delivered to users for OTP verification, account activation, and other authentication flows. SMS templates use the same theme editor as email and voice templates.

Prerequisite

  • A custom theme created and assigned to one or more workspaces.

Edit SMS templates

  1. Go to Tenant Settings > Appearance > Themes.

  2. Create a new theme or select an existing theme.

  3. Select the Messages tab.

  4. Expand SMS MESSAGES and select a template:

    TemplateDescription
    Activate Account With CodeSMS sent when a user activates their account with an OTP code.
    Activate Account With LinkSMS sent with an activation link.
    Address Verification With LinkSMS sent to verify a phone number.
    Identifier TakenSMS sent when a user tries to register with an identifier already in use.
    Verification CodeSMS sent with an OTP code for MFA verification.
    Reset Credentials With CodeSMS sent with a code to reset credentials.
    Reset Credentials With LinkSMS sent with a link to reset credentials.
  5. Select index.tmpl to open the template in the editor.

  6. Edit the template content. Templates use Go template syntax with translation keys and data variables.

  7. Click Save.

SMS template syntax

SMS templates use the T function to pull localized text from the translations layer, combined with data variables passed in at render time.

For example, the default Verification Code template:

{{ T "texts.otp.message" (dict "Code" .Data.OTP.Code) }}

This renders as: "Dear Customer, 777777 is your single-use verification code."

ElementDescription
{{ T "texts.otp.message" }}Inserts the localized message text from the translations layer.
.Data.OTP.CodeThe OTP verification code value.
(dict "Code" .Data.OTP.Code)Passes the OTP code as a named parameter to the translation string.

To change the message wording, edit the translation string in the theme's Translations section rather than the template file itself.

See also