I want the subject line of an approval notification email to show “SECRET APPROVAL REQUIRED” when the requestee’s custom attribute (e.g., employeeType) is set to “NPAUser”. Otherwise, it should default to “APPROVAL REQUIRED”.
I tried using this logic inside the Subject tag like this:
This works fine in the Body, but while saving the template, I get a runtime error, possibly related to subject length or invalid content for the XML element.
Is there a safe and supported way to use conditional logic inside Subject without triggering validation or length issues?
Can we declare shared variables once and use them across both Subject and Body?
Are there any best practices or examples for handling short dynamic subject lines in SailPoint email templates?
Any advice or working patterns would be greatly appreciated!
SailPoint allow max 256 characters in the subject line, if you are uabble to achive the business requirement with this, you can pass the subject line from wherever you are calling the Email, you can pass that subject line as one of the argument to the email template
Hi @Arun-Kumar
Is it possible that subject is not capable of doing this. It can only populate predefined values inside sailpoint?
Because this same approach I am using inside body and getting correct result but here under subject when I am adding this logic then its skipping to else condition.
try to just add $requestee in subject to see if you are getting this object in Subject. also can u send me latest code that you are testing ? may be you can pass employeeType from workflow else you need to get object in email from name or Id whatever you have.
Hi @pravin_ranjan
Just checked $requestee inside subject tag as well as body tag.
In body tag it displayed data but in Subject tag it just populated $requestee as output