Passwordless Login Message Template

On this page

FusionAuth sends this message when a user requests a passwordless login with a phone number, on the hosted login pages or through the Passwordless API. Assign the template in Passwordless login on the Tenants -> Your Tenant -> Identities tab. To override the template for one Application, set the template on the Applications -> Your Application -> Identities tab.

Default Template#

FusionAuth ships the following default template:

[#setting url_escaping_charset="UTF-8"]
You have requested to log into FusionAuth using this phone number. If you do not recognize this request please ignore this message.

[#if oneTimeCode??]
  Login code: ${oneTimeCode}
[#else]
[#-- The optional 'state' map provided on the Start Passwordless API call is exposed in the template as 'state' --]
    [#assign url = "${baseUrl}/oauth2/passwordless/${code}?tenantId=${user.tenantId}" /]
    [#list state!{} as key, value][#if key != "tenantId" && value??][#assign url = url + "&" + key?url + "=" + value?url/][/#if][/#list]

    ${url}
[/#if]

- FusionAuth Admin

Replacement Variables#

application
  • Type: Application

The Application object. For field definitions, see the Application API.

The variable is present only when the request that sends the message identifies an Application. Check for the variable before you use it:

[#if application??]
  ${application.name}
[/#if]
baseUrl
  • Type: String
  • Available since 1.68.0

The base URL for links in the message. FusionAuth uses the Application baseURL, then the Tenant baseURL, then http://localhost:9011.

code
  • Type: String

The code for the Complete a Passwordless Login API. Put the code in a login link.

oneTimeCode
  • Type: String

The one-time code the user enters on a form, for the FormField login strategy. Check for the variable before you use it, as the default template does.

phoneNumber
  • Type: String
  • Available since 1.59.0

The phone number FusionAuth sends the message to. The Generic messenger request has the same value in phoneNumber.

state
  • Type: Object

The state from the passwordless start request. The variable is present only when the request includes state.

tenant
  • Type: Tenant

The Tenant object. For field definitions, see the Tenant API.

user
  • Type: User

The User object for the recipient. For field definitions, see the User API.