The CreatorCon Call for Content is officially open! Get started here.

Email notification condition on who receives an email

SC10
Kilo Guru

Under an email notification of mine, I want to script a condition that will control who will receive the email, not a condition to control when it will send.

My email recipients are currently dynamic from fields on my Request form, Requested By (custom) and Client. In my situation, I want this Request notification email to only go to the username in the "Requested By" field if there are not part of a certain user group (IT ServiceDesk). If they are part of the IT ServiceDesk group as "Requested By", there is simply no reason why they would need to receive this Request opened notification email (due to them already logging it, they'd know about the request).

Any ideas?

10 REPLIES 10

My other condition would be to compare the value of two fields, to see if the value is the same. This would as well prevent the email from working. The condition is based on either of these conditions being true, hence my || instead of &&.



Do I need to do a getValue call, or will this be sufficient?




if (gs.getUser().isMemberOf("IT ServiceDesk") || current.u_requested_by == current.requested_for) {


answer = true;


}



Edit: I just realized this is not working, because gs.getUser is grabbing the person who is opening the record, instead of my "Requested for" field user. Any idea how to have it reference that "Requested for" field instead of the current user?