Emails
Emails sent from your app are triggered by specific events and serve as the primary communication method with your customers. The Frontegg portal offers multiple email templates, with several templates enabled by default. When an important event occurs, your application automatically sends the user the appropriate email template.
Frontegg’s email templates cover a range of scenarios triggered by user activities in your app. These templates include actions such as sending recovery codes for account activation/unlock, password resets, tenant invitations, magic link requests, and more.
Customizing email templates
Customizing email templates
You can customize the content and design of each email template to reflect your branding and message.
Configurations mirroring between environments
Configurations mirroring between environments
Frontegg automatically mirrors email configurations across environments. For example, when switching from development to production, Frontegg carries over the development email configurations to production.
Customizing email templates
To customize email templates, follow these steps:
Step 1: Select email templates
- Open the Frontegg portal.
- Navigate to [ENVIRONMENT] → Configurations → Authentication → Emails.
- The email page lists available templates. Most templates are Active by default, which you can confirm on the right side of the table.
- Change the template status by clicking its name and toggling between Active/Inactive.
Email templates in different environments
Email templates in different environments
Manage email templates separately for each environment.
You can enable or disable each email template based on your needs. When an event occurs, your application will send an email using any templates you have enabled for that event.
The table below provides template names, descriptions, and triggering events:
Template Name | Description | Event | Available Variables |
---|---|---|---|
Reset password | Sent to a user when they reset their password. | Password reset | name , email , phoneNumber , profilePictureUrl , redirectURL |
Activate user | Sent to a user when they activate their account. | Account activation | name , email , phoneNumber , profilePictureUrl , redirectURL , roleIds , roleNames , roleKeys , applicationId |
Invite to account | Sent to a user when invited to join a tenant. | Join tenant invitation | name , email , phoneNumber , profilePictureUrl , issuer details ,roleIds , roleNames , roleKeys , applicationId |
Pwned password | Checks if a user’s password has been exposed in a data breach upon signup or change. | Login and signup | name , email , phoneNumber , profilePictureUrl , timesPwned |
Magic link | Sends a magic link for passwordless authentication during login or signup. | Login and signup | name , email , phoneNumber , profilePictureUrl , redirectURL , expires |
Magic code | Sends a one-time code for passwordless authentication during login or signup. | Login and signup | name , email , phoneNumber , profilePictureUrl , code |
Connect new device | Notifies the user when someone logs in from a new device. | Login and signup | name , email , phoneNumber , profilePictureUrl , metadata attributes |
User used invitation | Sent to the tenant manager when a user accepts an invitation to join the tenant. | Tenant invitation accepted | name , email , phoneNumber , profilePictureUrl |
MFA Enroll | Notification sent when multi-factor authentication (MFA) is enabled on an account. | MFA enrollment | name , email |
MFA unenroll | Notification sent when MFA is disabled on an account. | MFA unenrollment | name , email |
MFA method added | Notification sent when a new MFA method is added to the account. | New MFA method added | name , email |
MFA recovery code | Sent when a recovery code is used to access an account. | MFA recovery code used | name , email |
MFA method removed | Notification sent when an MFA method is removed from the account. | MFA method removed | name , email |
Email Verification | Sent to users signing up with Microsoft Social login, prompting email verification. | Login and signup | redirectURL |
Brute force protection | Alerts the user after multiple login attempts with an incorrect password. | Security alert | name , email |
Suspicious IP | Sent when login activity is detected from an unfamiliar IP address. | Security alert | name , email |
Account challenge with code | Sends a verification code for MFA login challenges. | MFA challenge | name , email , phoneNumber |
Impossible travel | Sent when login activity occurs from distant locations within a short time frame. | Security alert | name , email |
Bot detection | Sent when suspicious login activity suggests a potential bot. | Security alert | name , email |
SMS authentication enabled | Sent when SMS authentication is enabled. | SMS authentication enabled | name , email |
Unlock account | Sent to users when they need to unlock their account. | Account unlock | name , email , phoneNumber , redirectURL |
Unlock account success | Sent when the user successfully unlocks their account. | Account unlock success | name , email |
Activate user with code | Sends an activation code to users for account activation. | Account activation | name , email , phoneNumber , profilePictureUrl , redirectURL , code |
Invite to account with code | Sends an invitation code to join a tenant. | Join tenant invitation | name , email , phoneNumber , profilePictureUrl , redirectURL , code |
Opting for the default configuration
Opting for the default configuration
Leaving email templates in their default setup is completely fine. However, depending on how your application is configured, not all templates may be relevant, and some may need additional setup to function as intended.
Once you enable an email template, you can either use the default content and styles or customize it. See the details below to learn how to adjust the email templates to fit your needs.
Webhooks
Webhooks
Frontegg also provides webhook notifications. Learn more about setting up webhook subscriptions.
Step 2: Customize email templates
Our template forms allow for extensive customization, enabling you to adjust each template’s content and design. For each template, set up the sender address, subject, redirect URL, message content, format, logo, and more. You can also edit the HTML to match your preferred layout.
Form inputs
Each template includes unique form inputs, with some inputs shared across all templates (such as sender address, sender name, subject, and message). Customize each input for every template, with specific inputs varying by template.
Additional inputs in select templates
Input | Description |
---|---|
Redirect URL | Root part: {{LOGIN_URL}} , e.g., {{LOGIN_URL}}/account/reset-password . Replace only the root part with your application URL, but keep the remaining path (/account/reset-password ) intact. |
Success Redirect URL | URL to redirect users to after completing the flow. |
Message | HTML content of the email. |
Message content
Define the content, layout, and design of each email.
Handlebars
Handlebars
Frontegg email templates use standard handlebars and support the below statements:
{{if}}
and{{else}}
{{#ifEqual}}
{{contains}}
{{#each}}
Content customization exceptions
Content customization exceptions
Ensure {{name}}
and {{redirectURL}}
are included in templates that have inputs for these values.
Email variables
Make emails dynamic and personalized by including variables, as shown below:
Variable | Description |
---|---|
{{applicationId}} | The ID of the application that a user is being invited to. |
{{name}} | Email recipient's name (required in HTML templates with redirect URL). |
{{email}} | Recipient's email address. |
{{phoneNumber}} | Recipient's phone number. |
{{profilePictureUrl}} | Recipient's profile picture URL. |
{{redirectURL}} | Redirect URL as configured. |
{{tenantName}} | Name of the tenant sending the email. |
{{tenant.xxx}} | Any attribute on the tenant object with a value. |
{{metadata}} | Recipient's user metadata. |
{{metadata.xxx}} | Custom attributes saved on the user's metadata. |
{{roleIds}} | An array of roleIds that are assigned to the recipient. |
{{roleNames}} | An array of roleNames that are assigned to the recipient. |
{{roleKeys}} | An array of roleKeys that are assigned to the recipient. |
{{timesPwned}} | Number of times the password was found in breaches (for Pwned Password template only). |
{{issuerName}} | Name of the user who triggered the email. |
{{issuerEmail}} | Email of the user who triggered the email. |
{{issuerMetadata}} | Metadata of the user who triggered the email. |
{{issuerProfilePictureUrl}} | Profile picture URL of the user who triggered the email. |
To use a variable, wrap it in double curly braces within your HTML template, e.g., {{name}}
or {{tenantName}}
.
Layout and design
To set the layout and design of each template, use the HTML Editor.
You can preview and test your changes by selecting the Launch Preview button.
Customized vs. default
Customized vs. default
All templates are pre-configured, but not every template may be needed. For example, if using passwordless authentication, customizing MagicLink and OTC templates is useful, while ResetPassword may not be necessary.
External providers and limitations
Emails that are being sent from Frontegg's domain use SendGrid, with a limit of 100 emails per day to prevent domain abuse.
To ensure uninterrupted email delivery, you can configure your own email provider. It can be added either via this API or via the UI in the Frontegg portal.