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 key to the web.config file
On the server where the FintechOS installation package resides, go to the web.config file and provide the name of the automation script name which customizes the email template, by adding the following key:
<appSettings>
<add key="ResetPasswordEmailTemplateWorkflowName" value="WorkflowName"/>
...
</appSettings>
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’.
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:
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:
{
"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.