User Actions Email Template
On this page
FusionAuth sends a User Action email when someone applies a User Action to a user, and asks FusionAuth to email the user. A time-based action can send an email in each phase: start, modify, cancel, and end. An action without a duration sends only the start email. Assign the templates in Start template, Modify template, Cancel template, and End template on the action under Settings -> User Actions .
FusionAuth sends the email only when the action has Email user when action is taken enabled, and the request sets action.emailUser to true. All four templates receive the same variables, so one template can serve every phase by checking phase.
Example Template#
FusionAuth ships no default for this template. Start from the following example:
[#switch "${phase}"]
[#case "start"][#assign message = "The ${action.name} action was applied to your account."][#break]
[#case "modify"][#assign message = "The ${action.name} action on your account changed."][#break]
[#case "cancel"][#assign message = "The ${action.name} action on your account was canceled."][#break]
[#default][#assign message = "The ${action.name} action on your account ended."]
[/#switch]
<p>
${message}
</p>
[#if (event.reason)??]
<p>
Reason: ${event.reason}
</p>
[/#if]
- FusionAuth Admin[#switch "${phase}"]
[#case "start"][#assign message = "The ${action.name} action was applied to your account."][#break]
[#case "modify"][#assign message = "The ${action.name} action on your account changed."][#break]
[#case "cancel"][#assign message = "The ${action.name} action on your account was canceled."][#break]
[#default][#assign message = "The ${action.name} action on your account ended."]
[/#switch]
${message}
[#if (event.reason)??]
Reason: ${event.reason}
[/#if]
- FusionAuth AdminReplacement Variables#
actionThe User Action object, such as action.name. For field definitions, see the User Actions API.
baseUrlThe base URL for links in the email. FusionAuth uses the Application baseURL, then the Tenant baseURL, then http://localhost:9011.
eventThe User Action event, with details such as event.reason and event.expiry. The variable is missing when a CleanSpeak moderation decision triggers the action.
phaseThe phase of the action: start, modify, cancel, or end.
tenantThe Tenant object. For field definitions, see the Tenant API.
userThe User object for the user who received the action. 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.