I am looking for a way to stop sending email in a particular case, let me explain this one !
I have workflow that getting some attibutes by using Identity Attribute Changed trigger.
I retrieve all modification in a generic Define Variable operation.
Howerver, I would like check if all attributes are valuated and not null in the same time, by using apache velocity in the body of a Send Email Action.
If all attributes are null, I would like to stop sending email notification, instead of sending a empty notification.
If it is about attribute validation, then you may add a step ahead of your mail send and there you can validate if the use-case is valid and if not then send mail.
You can also prevent Identity Security Cloud from sending emails on a per-email-template basis by specifying any of the following keywords as the first word in the template’s Subject field:
#stop
no_send
Stop
What if you add any of the above statements inside a velocity if condition. Never tried, but it is a simple way.
I also use this complex velocity script in my email subject for sending or blocking email based on condiftion :
#set($block='false')#foreach($item in $approvalSet.items)#if($item.applicationName=='IdentityNow [source]')#if($item.name=='role')#if($item.operation=='Remove')#set($block='true')#end#end#end#end#if($block=='true')#stop#{else}Modif#end
I reduce all space and some checking for 250 max lengths constraint in the subject
These options work in the built in ISC Email Templates subject line.
In order to stop sending emails from your workflow, the ideal way would be to add a Verify Data Type action before your Send Email action. In that step you can verify if data is Exists or Is Null and accordingly either end workflow or Send Email.
But, the problem is that I need to verify that all of my variables, inside the “Define Variable” Operation, are not null or equal to " " (so, all variables must be valued to avoid an empty email).
After this verification, I could block or pass the Send Email Action.