How To Stop Specific Email notifications

I have been digging into suppressing notification emails for specific requesters in ISC, mainly for service accounts and entitlements that need to be quietly revoked. Was told in an Ask the Architect that this was not possible.

But I kept seeing this mentioned as an offered solution in the forums, but never a real example, or report of it working. So, PSA it works. Notification templates support #stop in Velocity, this halts processing entirely. Wrapping that in some conditional logic in the subject on the templates prevents our unwanted emails from being sent, example:

#if($requesterName.contains("xxxx")) #stop #else $requesterName Has Requested to Revoke Your Access. #end

Did this on “Access Revoke Request Submitted” and “Revoke Request Successfully Submitted”. Requests from xxxx go dark, everything else emails like normal.

If someone’s got a cleaner or more widespread way to do this, I would love to hear it. Looking at editing a lot of templates, and the .contains makes me a little nervous that we could get other emails blocked on accident.

Hello John. You might want to consider replacing .contains() with an exact comparison and using the documented no_send keyword:

#if($requesterName == "xxxx")no_send#else${requesterName} Has Requested to Revoke Your Access.#end

This should help avoid unintended substring matches. #stop does halt Velocity rendering, but no_send or Stop might be a safer choice since they are officially documented for this purpose.

As far as I know, ISC does not currently support notification settings per user, so this condition would need to be added to each relevant email template.

Hi @jlbartle ,

This should work. First, verify that requesterName is returning the expected value in the email subject or body. If the output is correct, try either of these approaches:

Using contains():

#if($requesterName.contains("xxxx"))
  #stop
#else
  $requesterName Has Requested to Revoke Your Access.
#end

Using an exact match (==):

#if($requesterName == "xxxx")
  #stop
#else
  $requesterName Has Requested to Revoke Your Access.
#end