Overview

Configuration
Custom Email Templates can be figured in the Magic dashboard. Navigate to Customization, then Email to create and edit templates. The following is a list of variables that can be used when creating a custom email template in Magic. From the dashboard editor, variables must be wrapped in{{}}
in order to be resolved to their value. For example, to use the one-time passcode, insert {{otp}}
into the template.
otp
: One-time passcode. Example: 412320app.name
: The name of the application. Example: “My test app”user.email
: Email address of the user receiving the login email. Example: [email protected]template.locale
: Language of the user receiving the login email. Example: en_USlogin.device.browser
: Browser of the user receiving the login email. Example: Chromelogin.device.os
: Operating system of the user receiving the login email. Example: MacOSlogin.timestamp
: Timestamp of when email was requested
Usage
ℹ️ This feature is supported in Magic SDK 21.1.0 and above.
Testing
Once a template has been created, you can use the Send Test button at the bottom of the customization page to send an email to the account that is currently logged in. Note that test emails will contain placeholder values forotp
and magic_link
.
You can also view a live preview of your email in a separate browser window by selecting Preview from the overflow menu at the top of the page.
Testing the full end-to-end user experience will require publishing your template to a live development environment. To ensure the best results, we recommend utilizing a dedicated email testing service such as Litmus.
Production
In order to use the newly created template, thetemplate name
must be passed in as an argument into the login method.