Customizing Email Template in Sailpoint

Customizing Email Template in Sailpoint :(Sending the Account/Group Aggregation Task result via Email)

If want to notify task results to application owner follow below steps.

--> Create email notification as follow .


<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE sailpoint PUBLIC "sailpoint.dtd" "sailpoint.dtd">


<!--
  EmailTemplate for IIQ
-->
<sailpoint>

  <!--***********************************************************

  EmailTemplate

  *************************************************************-->

<EmailTemplate name="Notifying task results to application owner">
  <Description>
    Email Template for notifying task results to application owner.
  </Description>
  <Signature>
    <Inputs>
      <Argument name='taskResult' type='TaskResult'>
        <Description>Task Result</Description>
      </Argument>
      <Argument name='taskName' type='string'>
        <Description>Task Name</Description>
      </Argument>
      <Argument name='taskDesc' type='string'>
        <Description>Task Description</Description>
      </Argument>
      <Argument name='taskStartTime' type='date'>
        <Description>Time when task is started</Description>
      </Argument>
      <Argument name='taskEndTime' type='date'>
        <Description>Time when task is completed.</Description>
      </Argument>
      <Argument name='resultId' type='string'>
        <Description>Task Result Id</Description>
      </Argument>
  <Argument name='message' type='string' multi='true'>
        <Description>List of Messages</Description>
      </Argument>
    </Inputs>
  </Signature>
  <Body>
  <![CDATA[
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<style>
table {
  font-family: arial, sans-serif;
  border-collapse: collapse;
  width: 100%;
}

td, th {
  border: 1px solid #dddddd;
  text-align: left;
  padding: 8px;
}

tr:nth-child(even) {
  background-color: #dddddd;
}
</style>
</head>
<body>

<table cellpadding="0" cellspacing="0" width="588" style="background:#0987a0;text-align:left;border-bottom:0px solid #e4e4e4;">
        <tr valign="middle">
       
          <td><!-- CHANGE COLOR STYLE BELOW: blue - #98bec6 ; tan - #b5b192 -->
            <h2 style="color:#98bec6;font:bold 11pt Arial;text-transform:uppercase;">$taskResult.name Results</h2>
                             
          </td>
        </tr>
</table>

<table>

  <tr>
    <td>Task Name</td>
    <td>$taskResult.name</td>
 
  </tr>
  <tr>
    <td>Task Type</td>
    <td>$taskResult.type</td>
 
  </tr>
  <tr>
    <td>Task Description</td>
    <td>$taskResult.definitionDescription</td>
 
  </tr>
  <tr>
    <td>Task Run Time</td>
    <td>$taskResult.runLength</td>

  </tr>
  <tr>
    <td>Task Run Time Change</td>
    <td>$taskResult.runLengthDeviation</td>
 
  </tr>
  <tr>
    <td>Task Status</td>
    <td>$taskResult.completionStatus</td>
 
  </tr>
   <tr>
    <td>Task Started By</td>
    <td>$taskResult.launcher</td>
  </tr>
   <tr>
    <td>Task Started</td>
    <td>$spTools.formatDate($taskStartTime,3,1)</td>
  </tr>
   <tr>
    <td>Task Completed</td>
    <td>$spTools.formatDate($taskEndTime,3,1)</td>
  </tr>
   <tr>
    <td>Task Average Run Time</td>
    <td>$taskResult.runLengthAverage</td>
  </tr>
   <tr>
    <td>Task Host</td>
    <td>$taskResult.host</td>
  </tr>
</table>
<table>
 #set($attriMap=$taskResult.getAttributes().getMap())
 #foreach($mapEntry in $attriMap.entrySet())
<tr>
    <td>$mapEntry.key</td>
    <td>$mapEntry.value</td>
  </tr>
#end
</table>
  <h2 style="color:#98bec6;font:bold 11pt Arial;text-transform:uppercase;">The '$taskName' task#if ($status == "Success" ) ended successfully.#{end}#if ($status == "Warning" ) ended with warning.#{end}#if ($status == "Terminated" ) terminated.#{end}#if ($status == "Error" ) ended with error.#{end}</h2>
</body>
</html>
]]>
  </Body>
  <Subject>Task $taskName Status - $status </Subject>
</EmailTemplate>

</sailpoint>

--> Save the above email notification to EmailTemplateNotification.xml in local .
--> Import the EmailTemplateNotification.xml file into the sailpoint using IIQ console.
     Open the command prompt in C:\Sailpoint\tomcat\webapps\identityiq\WEB-INF\bin location and run IIQ console.
C:\Sailpoint\tomcat\webapps\identityiq\WEB-INF\bin>iiq console
import C:/Sailpoint/EmailTemplateNotification.xml
--> Go to aggregation task and enable the email task alert as below.
   
   

--> Configure the email properties as below .

   

--> Run the aggregation task see the results in redirection file name.

   
   

Comments

  1. Thanks Jagan very nice one.
    Having one doubt , In aggregation task which one we need to execute?
    Regards,
    Raju

    ReplyDelete

Post a Comment

Popular posts from this blog

Custom scheduled task in Sailpoint