Configure email message templates
Customize emails sent to users for verification, onboarding, and other authentication workflows. Email templates use the theme editor and support HTML, CSS, Go template syntax, and translation keys.
Prerequisite
- A custom theme created and assigned to one or more workspaces.
Base email template
All email templates inherit from a shared layout defined in base_email.tmpl. Edit this file to change global styles, headers, and footers that apply across all emails.
-
Go to Tenant Settings > Appearance > Themes.
-
Create a new theme or select an existing theme.
-
Select the Messages tab.
-
Go to Components >
base_email.tmpl. -
Edit the shared layout. For example, to add a social media footer below the
footer-logodiv:FIND US ON:
<a href="https://twitter.com/SecureAuthTEAM">
<img class="footer-image" src="https://www.svgrepo.com/show/416494/connect-media-networking.svg">
</a>
<a href="https://github.com/SecureAuthCorp">
<img class="footer-image" src="https://www.svgrepo.com/show/416517/code-github-hosting.svg">
</a> -
Click Save and preview any email template to validate the layout.
Edit individual email templates
-
Expand EMAILS and select a template:
Template Description Activate Account With Code Email sent when a user activates their account with an OTP code. Activate Account With Link Email sent with an activation link. Address Verification With Link Email sent to verify an email address. Identifier Taken Email sent when a user tries to register with an identifier already in use. Verification Code Email sent with an OTP code for MFA verification. Reset Credentials With Code Email sent with a code to reset credentials. Reset Credentials With Link Email sent with a link to reset credentials. -
Select index.tmpl to open the template in the editor.
-
Edit the HTML content. Templates use Go template syntax with translation keys and data variables.
-
Click Save.
Email template syntax
Email templates combine HTML with Go template functions. Display text is pulled from the translations layer using the T function, and dynamic data is injected through template variables.
For example, the Activate Account With Code template:
{{ template "base_email" . }}
{{ define "content" }}
<div class="heading2">
{{ T "emails.activate_account_with_code.heading" }}
<b>{{ T "emails.activate_account_with_code.body" }}</b>
</div>
<div class="main-text">{{ T "emails.activate_account_with_code.instruction" }}</div>
<div class="code-container">{{ .Data.OTP.Code }}</div>
{{ end }}
| Element | Description |
|---|---|
{{ template "base_email" . }} | Inherits the shared layout from base_email.tmpl. |
{{ define "content" }} | Defines the content block that gets inserted into the base layout. |
{{ T "emails...." }} | Inserts localized text from the translations layer. |
{{ .Data.OTP.Code }} | The OTP verification code value. |
{{ .Data.OTP.Link }} | A direct activation or verification link. |
To change the message wording, edit the translation string in the theme's Translations section rather than the template file itself.