How to access the notification record itself within the "Advanced Condition" Script field of the Notification record

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-06-2016 05:17 AM
Hi folks,
I've a little odd question but I was wondering if there is any posibility to access by script the Notification [sysevent_email_action] record from within the "Advanced Condition" field of the notification.
I want to retrieve the sys_id of the notification record itself and want to make it part of the condition to check wheather or not a notification should be send out.
I know that creating Events is the normal way of how to determine if a notification should be send or not.
But in my case there could be dozens of new notifications that should be able to be send out by script, it could be long-winded to create an event for each and every new mail.
It would be easier for example to only create one event that each of those notifications are listening to. And in addition the sys_id of the actual notification will be passed over as an event parameter. Then the only thing we need to check in the Advanced Condition field is, if the passed over sys_id matches the notification record or not.
Unfortunately I don't know if the notification record is accessible.
I was hoping that maybe "template" was the object I was looking for, but unfortunately it is only available at the "What it will contain" section, and not in the "When to send" Advanced Condition.
Maybe someone of you could give me a hint.
Alternatively I would be totally happy if there is any scriptable way to send out a mail based on a notification record without using the eventQueue.
Thanks and regards,
Basti

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-06-2016 06:42 AM
Hi Bastian,
I like where you are heading with this. It sounds like you are most of the way there. You have a table full of parameters that your customer can use to configure the various conditions and notifications. If I read this right, you can add a parameter to determine which notification (or event trigger) is to be used. This may be a bit over simplified, but keep thinking of ways to let them just manage data to avoid future development changes. If you start hard coding sys_ids in to notifications and scripts, you're guaranteeing you will have to come back and make revisions later. I hope that made sense and helps.