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
-
Go to Tenant Settings > Appearance > Themes.
-
Create a new theme or select an existing theme.
-
Select the Messages tab.
-
Expand SMS MESSAGES and select a template:
Template Description Activate Account With Code SMS sent when a user activates their account with an OTP code. Activate Account With Link SMS sent with an activation link. Address Verification With Link SMS sent to verify a phone number. Identifier Taken SMS sent when a user tries to register with an identifier already in use. Verification Code SMS sent with an OTP code for MFA verification. Reset Credentials With Code SMS sent with a code to reset credentials. Reset Credentials With Link SMS sent with a link to reset credentials. -
Select index.tmpl to open the template in the editor.
-
Edit the template content. Templates use Go template syntax with translation keys and data variables.
-
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."
| Element | Description |
|---|---|
{{ T "texts.otp.message" }} | Inserts the localized message text from the translations layer. |
.Data.OTP.Code | The 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.