Skip to main content

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.

  1. Go to Tenant Settings > Appearance > Themes.

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

  3. Select the Messages tab.

  4. Go to Components > base_email.tmpl.

  5. Edit the shared layout. For example, to add a social media footer below the footer-logo div:

    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>
  6. Click Save and preview any email template to validate the layout.

Edit individual email templates

  1. Expand EMAILS and select a template:

    TemplateDescription
    Activate Account With CodeEmail sent when a user activates their account with an OTP code.
    Activate Account With LinkEmail sent with an activation link.
    Address Verification With LinkEmail sent to verify an email address.
    Identifier TakenEmail sent when a user tries to register with an identifier already in use.
    Verification CodeEmail sent with an OTP code for MFA verification.
    Reset Credentials With CodeEmail sent with a code to reset credentials.
    Reset Credentials With LinkEmail sent with a link to reset credentials.
  2. Select index.tmpl to open the template in the editor.

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

  4. 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 }}
ElementDescription
{{ 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.

See also