Customize Reset Password Email Template

You can customize the reset password email template using server scripting (automation scripts) by following two steps:

Step 1. Add a specific secret in Vault

Add the following secret in Vault file in order to provide the name of the automation script name which customizes the email template.

Key Path Key Name Key Value
kv/<environment>/<application>/app-settings ResetPasswordEmailTemplateWorkflowName WorkflowName

 

If you do not provide the name of the automation script for email template customization, the system will search for an on-demand automation server script named “FTOS_ResetPasswordEmail”. For backwards compatibility, the system also searches for ‘ResetPasswordEmail’.

NOTE  The FTOS_ResetPasswordEmail” on-demand automation server script does not exist by default; you have to create it.

Step 2. Create FTOS_ResetPasswordEmail on-demand automation script

The automation script offers customization based on associated user and roles.

The new password reset email template must be returned as the “emailTemplate” key of the Values property:

Copy
var user = context.Values["user"];
for(var i=0;i<user.Roles.length;i++)
        {
            let role = user.Roles[i];
            if (role.Name == "special")
                {
                context.Values["emailTemplate"] = "SpecialEmailTemplate";
                break;
                }
        }

The user value has the following format:

Copy
{
    "UserName" : "user1",
    "BusinessUnitId" : "guid",
    "DisplayName" : "user display name",
    "Email" : "user email",
    "ExternalId" : "guid",
    "OrganizationId" : "guid"
    "Roles" :
        [
            {
                "SecurityRoleId" : "guid",
                "Name" : "role name 1"
            },
            {
                "SecurityRoleId" : "guid",
                "Name" : "role name 2"
            },
        ]
}

For information on how to create an on-demand server automation scripts, see the FintechOS Studio User Guide, section Creating On-demand Server Automation Scripts.

Related Topics Link IconRelated Topics