Threat Detected Email Template
On this page
This feature requires an Enterprise plan.
FusionAuth sends this email when a user logs in from a new device, or when a login is suspicious. The default template handles both cases by checking event.type. Assign the template in Login with new device, Suspicious login, or both, on the Tenants -> Your Tenant -> Identities tab. To override the template for one Application, set the template on the Applications -> Your Application -> Identities tab. For more about the events, see Advanced Threat Detection.
Default Template#
FusionAuth ships the following default template:
[#-- @ftlvariable name="event" type="io.fusionauth.domain.event.UserLoginSuspiciousEvent" --]
[#setting url_escaping_charset="UTF-8"]
[#if event.type == "UserLoginSuspicious"]
<p>A suspicious login was made on your account. If this was you, you can safely ignore this email. If this wasn't you, we recommend that you change your password as soon as possible.</p>
[#elseif event.type == "UserLoginNewDevice"]
<p>A login from a new device was detected on your account. If this was you, you can safely ignore this email. If this wasn't you, we recommend that you change your password as soon as possible.</p>
[#else]
<p>Suspicious activity has been observed on your account. In order to secure your account, it is recommended to change your password at your earliest convenience.</p>
[/#if]
<p>Device details</p>
<ul>
<li><strong>Device name:</strong> ${(event.info.deviceName)!'—'}</li>
<li><strong>Device description:</strong> ${(event.info.deviceDescription)!'—'}</li>
<li><strong>Device type:</strong> ${(event.info.deviceType)!'—'}</li>
<li><strong>User agent:</strong> ${(event.info.userAgent)!'—'}</li>
</ul>
<p>Event details</p>
<ul>
<li><strong>IP address:</strong> ${(event.info.ipAddress)!'—'}</li>
<li><strong>City:</strong> ${(event.info.location.city)!'—'}</li>
<li><strong>Country:</strong> ${(event.info.location.country)!'—'}</li>
<li><strong>Zipcode:</strong> ${(event.info.location.zipcode)!'—'}</li>
<li><strong>Lat/long:</strong> ${(event.info.location.latitude)!'—'}/${(event.info.location.longitude)!'—'}</li>
</ul>
- FusionAuth Admin[#setting url_escaping_charset="UTF-8"]
[#if event.type == "UserLoginSuspicious"]
A suspicious login was made on your account. If this was you, you can safely ignore this email. If this wasn't you, we recommend that you change your password as soon as possible.
[#elseif event.type == "UserLoginNewDevice"]
A login from a new device was detected on your account. If this was you, you can safely ignore this email. If this wasn't you, we recommend that you change your password as soon as possible.
[#else]
Suspicious activity has been observed on your account. In order to secure your account, it is recommended to change your password at your earliest convenience.
[/#if]
Device details
* Device name: ${(event.info.deviceName)!'—'}
* Device description: ${(event.info.deviceDescription)!'—'}
* Device type: ${(event.info.deviceType)!'—'}
* User agent: ${(event.info.userAgent)!'—'}
Event details
* IP address: ${(event.info.ipAddress)!'-'}
* City: ${(event.info.location.city)!'-'}
* Country: ${(event.info.location.country)!'-'}
* Zipcode: ${(event.info.location.zipcode)!'-'}
* Lat/long: ${(event.info.location.latitude)!'-'}/${(event.info.location.longitude)!'-'}
- 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.
eventThe User Login New Device or User Login Suspicious event. Device and location details are in event.info.
tenantThe Tenant object. For field definitions, see the Tenant API.
userThe User object for the recipient. For field definitions, see the User API.
Related
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.
API documentation for the FusionAuth Retrieve an Email Template API.