# User Actions Email Template

Learn when FusionAuth sends User Action emails, and which variables the templates receive.

> For the index of this section of the site, see [llms.txt](https://fusionauth.io/docs/llms.txt)

FusionAuth sends a User Action email when someone applies a [User Action](https://fusionauth.io/docs/users/user-actions.md) 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:

```ftl
[#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
```

```ftl
[#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 Admin
```

## Replacement Variables

`action`

*   Type: `Object`

The User Action object, such as **`action.name`**. For field definitions, see the [User Actions API](https://fusionauth.io/docs/apis/user-actions.md).

`baseUrl`

*   Type: `String`
*   Available since `1.68.0`

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

`event`

*   Type: `Object`

The [User Action](https://fusionauth.io/docs/events/reference/user/user-actions.md) event, with details such as **`event.reason`** and **`event.expiry`**. The variable is missing when a CleanSpeak moderation decision triggers the action.

`phase`

*   Type: `String`

The phase of the action: `start`, `modify`, `cancel`, or `end`.

`tenant`

*   Type: `Tenant`

The Tenant object. For field definitions, see the [Tenant API](https://fusionauth.io/docs/apis/tenants.md).

`user`

*   Type: `User`

The User object for the user who received the action. For field definitions, see the [User API](https://fusionauth.io/docs/apis/users.md).

Related

[APIs Create an Email Template API API documentation for the FusionAuth Create an Email Template API. freemarker](https://fusionauth.io/docs/apis/emails/create-an-email-template.md)

[APIs Email API Learn about the APIs for creating, retrieving, updating and deleting email templates as well as sending emails to users. freemarker](https://fusionauth.io/docs/apis/emails.md)

[APIs Preview an Email Template API API documentation for the FusionAuth Preview an Email Template API. freemarker](https://fusionauth.io/docs/apis/emails/preview-an-email-template.md)

[APIs Retrieve an Email Template API API documentation for the FusionAuth Retrieve an Email Template API. freemarker](https://fusionauth.io/docs/apis/emails/retrieve-an-email-template.md)
---

## Other pages in Template Reference

> For the full index of this section, see [Email](https://fusionauth.io/docs/llms-email.txt).

- [Email Verification Email Template](https://fusionauth.io/docs/email/template-reference/account/email-verification.md): Learn when FusionAuth sends the email that asks a user to verify an email address, and which variables the template receives.
- [Email Verified Email Template](https://fusionauth.io/docs/email/template-reference/account/email-verified.md): Learn when FusionAuth sends the email that confirms a verified email address, and which variables the template receives.
- [Forgot Password Email Template](https://fusionauth.io/docs/email/template-reference/account/forgot-password.md): Learn when FusionAuth sends the forgot password email, and which variables the template receives.
- [Passwordless Login Email Template](https://fusionauth.io/docs/email/template-reference/account/passwordless-login.md): Learn when FusionAuth sends the passwordless login email, and which variables the template receives.
- [Registration Verification Email Template](https://fusionauth.io/docs/email/template-reference/account/registration-verification.md): Learn when FusionAuth sends the email that asks a user to verify a registration, and which variables the template receives.
- [Set Up Password Email Template](https://fusionauth.io/docs/email/template-reference/account/set-up-password.md): Learn when FusionAuth sends the email that asks a new user to set up a password, and which variables the template receives.
- [Confirm Child Email Template](https://fusionauth.io/docs/email/template-reference/family/confirm-child.md): Learn when FusionAuth sends the email that asks a parent to confirm a child account, and which variables the template receives.
- [COPPA Email Plus Notice Email Template](https://fusionauth.io/docs/email/template-reference/family/coppa-email-plus-notice.md): Learn when FusionAuth sends the COPPA Email Plus reminder, and which variables the template receives.
- [COPPA Notice Email Template](https://fusionauth.io/docs/email/template-reference/family/coppa-notice.md): Learn when FusionAuth sends the COPPA consent notice, and which variables the template receives.
- [Family Request Email Template](https://fusionauth.io/docs/email/template-reference/family/family-request.md): Learn when FusionAuth sends the email that asks a parent to create an account for a child, and which variables the template receives.
- [Parent Registration Request Email Template](https://fusionauth.io/docs/email/template-reference/family/parent-registration-request.md): Learn when FusionAuth sends the email that asks a parent to create an account, and which variables the template receives.
- [Email Template Reference](https://fusionauth.io/docs/email/template-reference.md): Learn about the email templates FusionAuth sends and the replacement variables each template receives.
- [Admin Two-Factor Method Removed Email Template](https://fusionauth.io/docs/email/template-reference/security/admin-two-factor-method-removed.md): Learn when FusionAuth sends the email that tells a user an administrator removed a two-factor method, and which variables the template receives.
- [Breached Password Email Template](https://fusionauth.io/docs/email/template-reference/security/breached-password.md): Learn when FusionAuth sends the email that warns a user about a breached password, and which variables the template receives.
- [Email Update Email Template](https://fusionauth.io/docs/email/template-reference/security/email-update.md): Learn when FusionAuth sends the email that tells a user their email address changed, and which variables the template receives.
- [Login Id Duplicate on Create Email Template](https://fusionauth.io/docs/email/template-reference/security/login-id-duplicate-on-create.md): Learn when FusionAuth sends the email that tells a user someone tried to sign up with their login Id, and which variables the template receives.
- [Login Id Duplicate on Update Email Template](https://fusionauth.io/docs/email/template-reference/security/login-id-duplicate-on-update.md): Learn when FusionAuth sends the email that tells a user another account tried to take their login Id, and which variables the template receives.
- [Password Reset Success Email Template](https://fusionauth.io/docs/email/template-reference/security/password-reset-success.md): Learn when FusionAuth sends the email that confirms a password reset, and which variables the template receives.
- [Password Update Email Template](https://fusionauth.io/docs/email/template-reference/security/password-update.md): Learn when FusionAuth sends the email that tells a user their password changed, and which variables the template receives.
- [Threat Detected Email Template](https://fusionauth.io/docs/email/template-reference/security/threat-detected.md): Learn when FusionAuth sends the email for a login from a new device or a suspicious login, and which variables the template receives.
- [Two-Factor Authentication Email Template](https://fusionauth.io/docs/email/template-reference/security/two-factor-authentication.md): Learn when FusionAuth sends the email that contains a two-factor code, and which variables the template receives.
- [Two-Factor Method Added Email Template](https://fusionauth.io/docs/email/template-reference/security/two-factor-method-added.md): Learn when FusionAuth sends the email that tells a user a two-factor method was added, and which variables the template receives.
- [Two-Factor Method Removed Email Template](https://fusionauth.io/docs/email/template-reference/security/two-factor-method-removed.md): Learn when FusionAuth sends the email that tells a user a two-factor method was removed, and which variables the template receives.
