Forgot Password Context Output
The Forgot Password email template includes fields related to the user, portal, and password reset process, which can be used to customize the email. These fields allow templates to personalize the reset email and generate the appropriate password reset or OTP flow.
This article outlines the available context fields for the Forgot Password email template and how they can be used when customizing the password reset email.
Unlike standard email templates, the Forgot Password template context cannot currently be accessed as JSON through an API endpoint. Instead, the full context structure is defined internally and the available fields are listed below.
Context Structure
The Forgot Password template uses the following data structure:
type PasswordResetUser struct {
Email string `handlebars:"email" json:"email"`
FirstName string `handlebars:"first_name" json:"first_name"`
LastName string `handlebars:"last_name" json:"last_name"`
}
type PasswordResetPortal struct {
Name string `handlebars:"name" json:"name"`
Slug string `handlebars:"slug" json:"slug"`
Domain string `handlebars:"domain" json:"domain"`
}
type PasswordReset struct {
User PasswordResetUser `handlebars:"user" json:"user"`
Portal PasswordResetPortal `handlebars:"portal" json:"portal"`
Token string `handlebars:"token" json:"token"`
TokenType string `handlebars:"token_type" json:"token_type,omitempty"`
State string `handlebars:"state" json:"state,omitempty"`
OTP string `handlebars:"otp" json:"otp,omitempty"`
}
Available Template Fields
The following fields can be referenced when customizing the Forgot Password email template.
User Information
user.email
The email address associated with the user requesting the password reset.
user.first_name
The user's first name.
user.lastname
The user's last name.
Portal Information
portal.name
The name of the portal.
portal.slug
The portal slug.
portal.domain
The portal domain.
Password Reset Information
token
The unique password reset token used to generate the password reset link.
token_type
Specifies the type of reset process being used.
Possible values include:
-
reset – Standard password reset
-
otp – One-time password reset
state
Represents the current reset state associated with the request.
otp
The one-time password (OTP) sent to the user when the OTP reset flow is used.
For more information or questions about Forgot Password Context Output, please email support@ticketure.com.