Email notification is not sending during account creation

dear team,

i am implementing the approval notification.
Account creation approval notification is not sending as to the approver, as the approver will need to provide the approval.
while trying to send only selected information from the .csv items.
when selected all items mail is able to send

other notification email are able to send.

required your support to fix this.?

Hi @Riyazuddin99 ,

How are you creating, using OOTB access request option with “LCM Provisioning” workflow?

In that case, please check value for variable “approvalEmailTemplate“.

Could you please provide more details about your requirement? Are you implementing this using a standard workflow, or have you developed a custom workflow?

can you please tell your requirement more clearly, how you are sending the notification?? and if you can share your code ??

to be more clear with my requirement.

we are using slight modified default workflow for the joiner process.
where the actual requirement is about the email notification which is send to the manager for the approval.

in the email it hold additional details which are not required to be send in the email.

Subject: Account operations you requested for testtx14 were processed
MIME-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_10_679301877.1753862768322"
X-Mailer: smptsend

------=_Part_10_679301877.1753862768322
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 7bit


      


<html>
<head>
<style>


table, th, td {
    border: 1px solid black;
    border-collapse: collapse;
	font-family: 'Arial';
}
th, td {
    padding: 5px;
    text-align: left;    
}

th{
    color: blue;
	font-size: 14px;
}

td{
   font-size: 12px;
}




</style>
</head>
<Body>
Dear Requester,

<br> <br>
The following actions you requested for identity 'testtx14' has been APPROVED. <br> <br>


<table>
<tr>
     <th>Application:</th>
     <td>IdentityIQ</td>
</tr>

<tr>
     <th>Account:</th>
     <td>testtx14</td>
</tr>                
         

<tr>
     <th>Request Type:</th>
     <td>Create</td>
</tr>
           

<tr>
     <th>Requested Value(s):</th>
     <td>lastname = 'Testspt', firstname = 'Test', nationality = 'Indian', name = 'testtx14', contract_name = 'Testing contract Manpower Services Contract (FNRCO) ID:6600006666', company = 'Testing contract First National Human Resource', empGroup = 'Contractor', o365_license = '-', identity_type = 'Contractor', telNumber = '+966550709176', &quot;manager = 'Abdul, Rehman'&quot;, base_org_name = '-', dept = 'Hr Services Department Om', jobTitle = 'test IAM ENGINEER', &quot;Address = '&quot;&quot;Sadara Business Complex(RD 145, First Industrial Support area)&quot;&quot;'&quot;, Office = 'Admin building', mfa_mobile = '+966550709176', country = 'Saudi Arabia', State = 'Eastern', City = 'Jubail', Zip Code = '35717', post_box = '11811', Cost Center = '12345', division = '- HR Services Department om', orgName = 'HR Services Department om', base_org_id = '00000003', dept_id = '20000288', division_id = '00000000', org_unit = '20000238'</td>
</tr>          

</table>

Thanks, 
<br>Identity & Access Management Team.
</Body>
</html>


the above is the response which I am getting by the below code

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE EmailTemplate PUBLIC "sailpoint.dtd" "sailpoint.dtd">
<EmailTemplate name="Sadara Identity Create Line Manager Approval">
  <Body>
      

<![CDATA[<html>
<head>
<style>


table, th, td {
    border: 1px solid black;
    border-collapse: collapse;
	font-family: 'Arial';
}
th, td {
    padding: 5px;
    text-align: left;    
}

th{
    color: blue;
	font-size: 14px;
}

td{
   font-size: 12px;
}

</style>
</head>
<Body>
Dear $approverName,

<p>$requester is requesting the creation of a contractor account with the following details: </p>   

#if ( $approvalSet.items )

<table class = "table">
<tr>
  <th>Application</th>
  <th>Account</th>
  <th>Request Type</th>
  <th>Requested Value(s)</th>
  <th>Comments</th>
  
</tr>
#foreach ($approvalItem in $approvalSet.items)
<tr> 
    <td>$approvalItem.applicationName</td>     
#if ( $approvalItem.nativeIdentity )    
    <td>$approvalItem.nativeIdentity</td>
#else 
    <td>N/A</td>
#end           
    <td>$approvalItem.operation</td> 
#if ( $approvalItem.displayValue )
    <td>$approvalItem.displayValue</td>          
#elseif ( $approvalItem.csv ) 
    <td>$approvalItem.csv</td>    
#else 
    <td>N/A</td>
#end
#if ( $approvalItem.requesterComments )
    <td>$approvalItem.requesterComments</td>
#else <td>-</td>
#end
#end
#end

</tr>
</table>
<p style="font-style: italic;"> To approve/reject go to https://myaccess.sadara.com/identityiq/manage/workItems/workItems.jsf </p>

Kind Regards, 
<br>IAM Team
</Body>
</html>]]>


       
    </Body>
  <Description>
      Email Template for notifying the line manager when they need to approve a request for creating third party contractors.
    </Description>
  <Signature>
    <Inputs>
      <Argument name="workflow" type="Workflow">
        <Description>The Workflow object being executed.</Description>
      </Argument>
      <Argument name="item" type="WorkItem">
        <Description>The WorkItem representing the review.</Description>
      </Argument>
      <Argument name="approvalSet" type="ApprovalSet">
        <Description>The ApprovalSet object contained in the work item.</Description>
      </Argument>
      <Argument name="requester" type="string">
        <Description>The display name of the Identity (Sponsor) that launched the workflow.</Description>
      </Argument>
      <Argument name="approverName" type="string">
        <Description>The name of the first approver Identity (Line manager).</Description>
      </Argument>
      <Argument name="identityDisplayName" type="string">
        <Description>The display name of the Identity being changed.</Description>
      </Argument>
    </Inputs>
  </Signature>
  <Subject> Contractor account create request for $identityDisplayName needs approval </Subject>
</EmailTemplate>

where my requirement stands to have the notification with the limited as

Subject: Account operations you requested for testtx14 were processed
MIME-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_10_679301877.1753862768322"
X-Mailer: smptsend

------=_Part_10_679301877.1753862768322
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 7bit


      


<html>
<head>
<style>


table, th, td {
    border: 1px solid black;
    border-collapse: collapse;
	font-family: 'Arial';
}
th, td {
    padding: 5px;
    text-align: left;    
}

th{
    color: blue;
	font-size: 14px;
}

td{
   font-size: 12px;
}




</style>
</head>
<Body>
Dear Requester,

<br> <br>
The following actions you requested for identity 'testtx14' has been APPROVED. <br> <br>


<table>
<tr>
     <th>Application:</th>
     <td>IdentityIQ</td>
</tr>

<tr>
     <th>Account:</th>
     <td>testtx14</td>
</tr>                
         

<tr>
     <th>Request Type:</th>
     <td>Create</td>
</tr>
           

<tr>
     <th>Requested Value(s):</th>
     <td>lastname = 'Testspt', firstname = 'Test', name = 'testtx14',company = 'Testing contract First National Human Resource', empGroup = 'Contractor', &quot;manager = 'Abdul, Rehman'&quot;, dept = 'Hr Services Department Om', jobTitle = 'test IAM ENGINEER',</td>
</tr>          

</table>

Thanks, 
<br>Identity & Access Management Team.
</Body>
</html>

with lastname, firstnam, name, company, manager, dept, job title.

which are stored inside the $approvalItem.csv
When trying to get the data from csv the mail is not sending.

let me know if any additional information is needed

@Riyazuddin99 : This issue might be occurring because $approvalItem.csv is a single string. Extracting specific fields from it in the email template can cause Velocity errors. Instead of using $approvalItem.csv, you can pass the required attributes directly from the workflow to the EmailTemplate.

The problem is in how you’re trying to extract specific fields from $approvalItem.csv.

The .csv property returns a single comma-separated string of all attribute name-value pairs. It’s not a map or list you can selectively pick from using Velocity alone. It could be the issue.

The fix would be Instead of using $approvalItem.csv, use $approvalItem.attributes— this returns a Map. From that map, you can pull individual keys, like below

$approvalItem.attributes.get("lastname")
$approvalItem.attributes.get("firstname")
and similarly for other attributes.

So in your template, replace the $approvalItem.csv/ $approvalItem.displayValue block with individual rows pulling from $approvalItem.attributes.get(“attributeName”) for only the fields you want to display.

Try it and see if it works.

Thanks for your response, Mr @naveenkumar3

I tried this method same error as my other approach.
mail is unable to send or failing.
as I am unable to see any mails in the mail.txt file at the server.

and also, I don’t see any error in the logs.

can you ( @sagr0812 ) provide a sample code that I can implement in the email temp.

Also tried in the lab setup on this
the output is coming as paragraph.
without any required information

The fix is NOT in the email template — it’s in the workflow, before the approval step.

You need to add a Script/Rule in the workflow step (before the approval notification is sent) that:

  1. Extracts only the fields you want from the provisioning plan / approval set
  2. Builds a custom variable(e.g., a Map or formatted String) with just lastname, firstname, name, company, manager, dept, jobTitle
  3. Passes that custom variable to the email template

In the Workflow

  • Find the Approval step and Look for where the approvalSet is being constructed or where the email template arguments are set. Add a before-script or a step just before it that creates a filtered map, something like:
// In a workflow script/rule - build a map with only needed fields
Map filteredAttrs = new HashMap();
// Extract from the provisioning plan or approval item attributes
filteredAttrs.put("lastname", plan.getAccountRequest().getAttributeRequest("lastname").getValue());
filteredAttrs.put("firstname", plan.getAccountRequest().getAttributeRequest("firstname").getValue());
// ... repeat for other fields
workflow.put("filteredAttrs", filteredAttrs);
  • Then in your email template, reference $filteredAttrs.get("lastname") etc.

@Riyazuddin99 You can try running a beanshell rule from the email to get the desired CSV values which you want to print.

Please follow this article: How can we pull the Display Value of an entitlement into a custom Remediation Notification email template in certifications? - #2 by sagr0812

You can launch the rule with the plan/approvalItem as argument and you can return the string values which you want. Check the beanshell script mentioned in above link as reference.

Note: Found a fix?Help the community by marking the comment as solution. Feel free to react(:heart:,:+1:, etc.)with an emoji to show your appreciation or message me directly if your problem requires a deeper dive.