Each notification should restricted to send max 5k email per day
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-10-2023 09:09 AM
I have a requirement to restrict 5k emails to be send per notification per day.
For this I have created one Counter field on Notification table. When email comes on sys_email table, system will increase the counter field of the related notification by 1.
If Counter of any notification exceeds 5k per day, then rest all emails for that notification will be send-ignored automatically.
Can anyone please recommend how to achieve this.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-10-2023 09:17 AM
@Ap_1 Following approach would be needed to implement the counter on notifications.
1. Business rule:Create an onBefore insert business rule on the sys_email table. Inside the script, make a GlideRecord query to your notification table and apply a filter of the notification name.
From the glide record query on notification, determine if the count of notification is less than 5000 if yes, increase the counter by one and update the notification record. else simply change the state of the current email to send-ignored.
2. Rest the counters: Since the counters on notification are only valid for a day, make sure to create a schedule job which will run at 23:59PM and will rest all the counters to 0.
Hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2023 08:09 AM
Hi Sandeep,
This didn't work.
I have written before BR on insert on sys_email table and then query on sys_email_log with current.email, then it is not fetching any record from sys_email_log.
That means when the BR is running, email log is not yet created.
Thanks,
Aparajita