Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
titleUse this to programmatically suppress your notification.
$jemhUtils.setInhibitSending(true)

An alternative to directly calling the jemhUtils method is to override a Velocity macro called inhibitSendingConditions provided in the system macros file. Once overridden it must be slightly adjusted in order for the 'if' statements to cause the notification to get inhibited. This is an example of the macro:

Code Block
titleAn example of inhibitSendingConditions
linenumberstrue
#macro (inhibitSendingConditions)
##
## Override this macro and uncomment its body to inhibit notifications depending on some conditions.
## For example conditions can be driven by recipient type and data. Replace false for any data driven condition.
## Note that request type needs to be checked/enabled in the notification mapping configuration to be later conditionally inhibited.
## This solution cannot add new recipients on the fly, just inhibit what it was previously calculated.
##
#*
#if ($jemhUtils.getRecipientType()=="REPORTER" && false) $jemhUtils.setInhibitSending(true) #end
#if ($jemhUtils.getRecipientType()=="ASSIGNEE" && false) $jemhUtils.setInhibitSending(true) #end
#if ($jemhUtils.getRecipientType()=="WATCHER" && false) $jemhUtils.setInhibitSending(true) #end
#if ($jemhUtils.getRecipientType()=="CURRENT_USER" && false) $jemhUtils.setInhibitSending(true) #end
#if ($jemhUtils.getRecipientType()=="PROJECT_LEADER" && false) $jemhUtils.setInhibitSending(true) #end
#if ($jemhUtils.getRecipientType()=="COMPONENT_LEADER" && false) $jemhUtils.setInhibitSending(true) #end
#if ($jemhUtils.getRecipientType()=="USER_CUSTOM_FIELD" && false) $jemhUtils.setInhibitSending(true) #end
#if ($jemhUtils.getRecipientType()=="GROUP_CUSTOM_FIELD" && false) $jemhUtils.setInhibitSending(true) #end
#if ($jemhUtils.getRecipientType()=="EMAIL_CUSTOM_FIELD" && false) $jemhUtils.setInhibitSending(true) #end
#if ($jemhUtils.getRecipientType()=="EMAIL_ADDRESS" && false) $jemhUtils.setInhibitSending(true) #end
#if ($jemhUtils.getRecipientType()=="JEMHC_ADMIN" && false) $jemhUtils.setInhibitSending(true) #end
#if ($jemhUtils.getRecipientType()=="SELECTED_USER" && false) $jemhUtils.setInhibitSending(true) #end
#if ($jemhUtils.getRecipientType()=="SELECTED_GROUP" && false) $jemhUtils.setInhibitSending(true) #end
#if ($jemhUtils.getRecipientType()=="REQUEST_PARTICIPANT" && false) $jemhUtils.setInhibitSending(true) #end
#if ($jemhUtils.getRecipientType()=="AUTO_CREATED_USER" && false) $jemhUtils.setInhibitSending(true) #end
#if ($jemhUtils.getRecipientType()=="OTHER" && false) $jemhUtils.setInhibitSending(true) #end
*#
#end

Common errors

Email hasn't been sent as no useful information was displayed based on the used template.

...