Two-Factor Authentication Email Template
On this page
FusionAuth sends this email with a code when a user completes a multi-factor login with the email method, or enables or disables the email method. Assign the template in Template under Tenants -> Your Tenant -> Multi-Factor -> Email settings . To override the template for one Application, set Email template on the Application's Multi-Factor tab.
Default Template#
FusionAuth ships the following default template:
<p>
To complete your login request, enter this one-time code code on the login form when prompted.
</p>
<p>
<strong>${code}</strong>
</p>
- FusionAuth AdminTo complete your login request, enter this one-time code code on the login form when prompted.
${code}
- FusionAuth AdminReplacement Variables#
applicationThe Application object. For field definitions, see the Application API.
The variable is present only when the request that sends the email identifies an Application. Check for the variable before you use it:
[#if application??]
${application.name}
[/#if]
baseUrlThe base URL for links in the email. FusionAuth uses the Application baseURL, then the Tenant baseURL, then http://localhost:9011.
codeThe code the user enters to complete multi-factor authentication.
tenantThe Tenant object. For field definitions, see the Tenant API.
userThe User object for the recipient. For field definitions, see the User API.
The application variable is missing when a request that sends the code has no applicationId. The requests are the following:
- Start Multi-Factor.
- The Login API, when multi-factor authentication is required. A production login request should always include
applicationId. - The requests that send a code to enable or disable a method.
Related
A list of default message templates.
API documentation for the FusionAuth Create an Email Template API.
Learn about the APIs for creating, retrieving, updating and deleting email templates as well as sending emails to users.
API documentation for the FusionAuth Preview an Email Template API.