- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-05-2022 03:27 PM
I have an after-insert business rule that I want to use to trigger an email notification. The Notification's When to Send is Event is fired. The business ruIe runs to completion and prints the gs.info() statements as expected. I fire the event, but the notification does not run and no email is generated. What am I doing wrong?
Business rule
(function executeRule(current, previous /*null when async*/) {
var recipients = "";
var event = "x_acso_rf_poc.rf.sr.notification";
var property_root = "x_acso_rf_poc.rf.sr.notification.recipients.";
gs.info("Business rule 'RF Service Request En Route for Service' running");
if(current.getDisplayValue("u_site").toLowerCase().contains("xxxxx")) {
gs.info("Raising event using xxxxx recipients");
recipients = gs.getProperty(property_root + "xxxxx") || "";
gs.eventQueue(event, current, recipients);
} else if (current.getDisplayValue("u_site").toLowerCase().contains("twiggs")) {
//etc
} else {
gs.warn("Site not recognized! No notification will be sent.");
}
gs.info("Business rule complete");
})(current, previous);
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-06-2022 09:51 AM
Hi
There could be numerous reasons why the notification isn't sent. We don't know what you've researched before this (hopefully, you've done some). There are numerous posts on the forums about this same situation and I've personally have responded with 8-10 bullet points of things to check.
Feel free to search the forums as there's great information out there.
Luckily, someone has already asked about you to clarify if the event itself even shows in your logs (you should have checked that first and foremost after seeing the info in your logs).
From there, if send to event creator, parm1 contains recipients is checked, no advanced condition on the notification (or ensuring it returns true if so), the notification is active, mail script, if used, isn't broken, which causes problems, the recipient is active and has a valid email primary channel setup in their preferences AND notifications turn on....and you don't have a before business rule on the sys_email table that may be aborting this....it should send.
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-06-2022 05:52 AM
Recipients is populated from a property, half way down screen shot #1. The property is my email address. I'm logging that out (not shown above).

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-06-2022 06:16 AM
Hey,
Check if email sending is enabled in your system.
Go to left navigation > Type Email properties > Check
Also, to check if the notifications are being sent, you can check in SN itself
Go to left navigation > Type Outbox
Feel free to mark correct, If I answered your query.
Will be helpful for future visitors looking for similar questions 🙂
Aman Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-06-2022 07:23 AM
Yes emailing is enabled. I've found only one scenario where it sends an email, and that is if I check Send to Event Creator. Even that does not send consistently.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-06-2022 09:35 AM
Well, the very reason flag "Send to Event Creator" exists is to enable sending e-mails even if the recipient and the user generating the event are the same person.
In other words, what you are experiencing is intended functionality working as designed. If you want to test with "Send to Event Creator" unchecked, use an e-mail address that does not identify your user.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-06-2022 07:02 AM
1. Check event logs and search by name if your event is getting fired.
2. In the same event logs check if parm1, parm2 and table have correct values.
After that we can check the issue with notifications.
Raghav
MVP 2023