Click HERE to see how Saviynt Intelligence is transforming the industry. |
07/15/2024 06:42 AM
Hi Team,
We are using the if else condition in email template and we need to add some more condition for different type of users. We are using these email templates via Endpoints
Template: This is working condition.
<% if (user?.cp == 'abc') print "Hi , ${user.firstname} ${user.lastname} ........
(Employee ID : ${user.employeeid})......... "else if(user?.cp =='xyz') print " ${user.firstname} ${user.lastname} (matricule : ${user.employeeid})" %>
we need to add more condition and tried with below condition.
1) ${user.cp1=='abc' && user.cp!=null ? Employeeid: ${user.customproperty24}} not able to save the template throwing error.
2) ${user.cp=='abc' && user.cp!=null ? user.customproperty24: ${user.customproperty24}} working but we need to add the text/word where we highlighted instead of user.customproperty24 we need to add employeeid.
Please help us to resolve the issue.
Thanks,
Sai Meghana
Solved! Go to Solution.
07/15/2024 07:03 AM
@saimeghana try this
<% if (user.cp.equals('xyz') print "abc" else print "user.emoloyeeid" %>
07/15/2024 07:06 AM
<%
if (user?.cp == 'abc' && user?.cp != null) {
print "Employee ID: ${user.employeeid}";
} else {
print "Custom Property: ${user.customproperty24}";
}
%>
07/15/2024 09:07 AM
Hi Rushikesh,
Tried with this condition still we are not able to save the template.
<% if (user?.cp == 'abc') print "Hi , <br><br> From ${user.startdate.format('ddMMyyyy')}, ${user.firstname} ${user.lastname} team. <%if (user?.entity == 'WW SuccessFactors' && user?.customproperty3!= null){ print "SAP SF ID: ${user.customproperty24}"} else { print "Employee ID: ${user.employeeid}"}%> <br><br> Please find below the data.<br><br>Logon ID : ${user.cp}"else if(user?.cp =='123' ||user?.cp=='456') print "Hello , <br><br> Good morning, ${user.firstname} ${user.lastname} (matricule : ${user.employeeid}) <br>Vous trouverez ci-dessous les codes <br><br>Identifiant de connexion : ${user.cp2} <br><br>Adresse email : ${user.email} <br><br>" %>
Error:
Thanks,
Sai Meghana
07/15/2024 11:29 AM
[14:01] Rushikesh Vartak
(${user?.entity == 'XXSuccessFactors' && user?.customproperty3 != null ? 'XXXX ID: ' + user.customproperty24 : 'Employee ID: ' + user.employeeid})
07/15/2024 11:38 AM
Thank you, it solved the issue