Saviynt unveils its cutting-edge Intelligence Suite products to revolutionize Identity Security!
Click HERE to see how Saviynt Intelligence is transforming the industry.
Saviynt Copilot Icon

Variables supported in email template of Service account

dhanashree_m
New Contributor III
New Contributor III

What is the variable that we can use for below scenarios:

1. Checking the account type in TO

Tried if(ServiceAccountOwnerMap!=null && ServiceAccountOwnerMap != 'null' && ServiceAccountOwnerMap != '' && !ServiceAccountOwnerMap.isEmpty() && ServiceAccountOwnerMap.get('ServiceAccountType') == 'Service Account') and account.accounttype=="Service account", but it didnot work

2. Sending the service account creation email to all owner

Tried 

${ServiceAccountOwnerMap.get("ALL")?.collect{it.email}?.join(',')} and ${accountOwners.collect{it.email}.join(',')} but it did not work

3. fetching owner full name as a list (append firstname lastname and then join this list)

-directly we have variable ${ServiceAccountOwnerMap.get("ALL")?.collect{it.username}?.join(',')} nothing for getting first name last name in loop as we dont have a limitation on owners 

5 REPLIES 5

rushikeshvartak
All-Star
All-Star

rushikeshvartak_0-1654012304593.png

 


Regards,
Rushikesh Vartak
If this helped you move forward, click 'Kudos'. If it solved your query, select 'Accept As Solution'.

account type check worked, thanks!

sagars
Saviynt Employee
Saviynt Employee

@dhanashree_m 

You can find the Service Account related binding variable information in below freshdesk documentation.

https://saviynt.freshdesk.com/a/solutions/articles/43000622153#ManagingEmailTemplates-ConfiguringSer...

Regards,
Sagar Srikantaiah

 

Paul_Meyer
Regular Contributor
Regular Contributor

For Email Templates, I have found the following very useful to know what variables are available, and what their type/values are,  at the point in time where the email template is processed.

Add the following into an Email Template for debugging purposes:

${this.binding.variables.each {k,v -> println "$k = $v" + "<" + "br" + ">"}}

 

amit_krishnajit
Saviynt Employee
Saviynt Employee

ServiceAccountOwnerMap - this binding is usually used in approval/workflow emails and may not be available in task related email templates. You may want to explore the following expressions. 

 

1. Checking the account type in TO

 

${if('Service Account'.equals(task?.accountKey?.accounttype)){ <<something>> } else {<<something>>}}

 

2. Sending the service account creation email to all owner - this is a little messy way, however should work for you.

${if('Service Account'.equals(task?.accountKey?.accounttype)){ def res = ''; task?.requestAccessKey?.collect{ it.request_access_attrss.findAll{it.attributeName.toString().equalsIgnoreCase('USEROWNERKEY')}.collect{it.attributeValue}.join('###')}?.get(0)?.split(',')?.eachWithIndex{ num, idx -> res = res + com.saviynt.ecm.identitywarehouse.domain.Users.get(num)?.email + ',';}; return res; } else{return user?.email}}

 

 

 3. Fetching owner full name as a list (append firstname lastname and then join this list) 

${if('Service Account'.equals(task?.accountKey?.accounttype)){ def res = ''; task?.requestAccessKey?.collect{ it.request_access_attrss.findAll{it.attributeName.toString().equalsIgnoreCase('USEROWNERKEY')}.collect{it.attributeValue}.join('###')}?.get(0)?.split(',')?.eachWithIndex{ num, idx -> res = res + com.saviynt.ecm.identitywarehouse.domain.Users.get(num)?.username + ' :: ' + com.saviynt.ecm.identitywarehouse.domain.Users.get(num)?.firstname + ' ' + com.saviynt.ecm.identitywarehouse.domain.Users.get(num)?.lastname + '<br>';}; return res; } else{return ''}}

 

 

Thanks,
Amit