Stop sending email inside "Send Email" Action - Workflow

Hello team,

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.

Is anyone think that possible ?

Thanks !

Hi @LEOS1,

Welcome back to SailPoint developer community.

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.

Let us know if you need further input.

Thanks

From SailPoint docs,

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.

Thanks
Krish

1 Like

Hi @LEOS1,

You can make use of the velocity template in the email subject. The logic would be to pass the value as STOP when your attribute is null.

#if(${!value})#stop#end Actual subject

Take a look at the below thread for reference.

2 Likes

Hi,

@LEOS1 concerning your needs to stop sending based some condition from your email body is not possible directly.

As say above the only way to stop email sending is to evaluate in your email subject.

In the email subject you can use velocity script in the same way that you use in body.

Not that email subject is limited to 250 that i confirm with Sailpoint in my following Post Email template condition and subejct max length

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

1 Like

Hello @all,

Thank you for your response !

Are you sure that stopping email notification actually works in the subject of a Send Email ?

Because, I tried with your solution

And the notification has been sent whatever ‘#stop’ or ‘no_send’ wrote in the subject.

Thanks !

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.

1 Like

Hello @sharvari,

Thank you for your response !

I agree with you.

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.

Thanks !

You may probably have to add those many Verify Data Type steps then. I know it may not be the best approach but it will work.

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.