Hi,
Below is the action to send the email
---------------------------------------------------------------------------------------------
// Get the list of employees who can recieve email token;
// Run Stored Procedure sp_GetRoleEmployees;
RolesId:= 6;
VarLocalEmployeesCSV:= RunStoredProcedure("sp_GetRoleEmployees","RolesId","2");
VarLocalEmployeesCSVCount:= CSVGetListCount(VarLocalEmployeesCSV);
VarLocalEmployeesCSVCounter:= 0;
while:(VarLocalEmployeesCSVCounter< VarLocalEmployeesCSVCount) {
PageId:= VarLocalInsertPageId; // id of the new row;
EmployeeId:= CSVGetListItemByIndex(""&VarLocalEmployeesCSVCounter,VarLocalEmployeesCSV,",","|",0);
EmailSendingTo:= CSVGetListItemByIndex(""&VarLocalEmployeesCSVCounter,VarLocalEmployeesCSV,",","|",4);
// Run stored procedure to create and get token;
VarToken:= RunStoredProcedure("sp_CreateNewToken","PageId,EmployeeId","2");
// Send Email;
SendHTMLEmail("Email Template",EmailSendingTo,"AttachmentDocument");
//Increment counter;
VarLocalEmployeesCSVCounter:= VarLocalEmployeesCSVCounter+ 1;
}