Scheduled Notifications: Overview
Scheduled Notifications: Overview
Developers and integrators can use Scheduled Notifications to help set up flexible and automatic email notifications for their applications and extensions.This is a toolkit that you can use to implement email notifications in your applications. The Compliance Management activity is an example of an application that uses the toolkit, but the toolkit is generic and intended for straightforward integration into any application.
You can use the toolkit to send notifications based on the status and dates of any record in the Action Items (activity_log) table. The Action Items table is used by a broad number of activities; therefore it is well-suited as the underlying table on which to base notifications. Some of the applications that use activity_log to store action/task/event items are:
- Leases
- Projects
- Condition Assessment
- Environmental Sustainability
- Hazard Abatement
- Compliance
- Commissioning
- Moves
- Maintenance (Service Requests)
- Service Desk
For the above applications, the type of action items in the activity_log table include events, tasks, reminders, and other types of activity.
You can use the Notifications toolkit to easily add scheduled notifications to customization or integration projects involving any of the above applications. The toolkit does not provide any reusable user interfaces (views), but you can use the notification-related views in the Compliance Management activity as examples and starting points for building your own.
If you would like to use the toolkit for an activity or customization to generate notifications on source records that are not stored in activity_log, then the recommended approach is to create activity_log records that mirror the source records for notification purposes.
Functionality
- Send email messages (notifications/reminders) about tasks or events in activity_log table based on flexible date and/or status based criteria.
- Set up multiple notifications with different criteria for the same task/event (e.g. remind when upcoming, overdue, missed, completed, etc.)
- Create reusable templates containing commonly used notification criteria, message contents, and recipients.
- Automatically resend notifications at configurable intervals until event status changes.
For information, see Creating a Scheduled Notification for an Event .
Components
The Scheduled Notifications toolkit consists of:
Component | Description | Help Topic |
---|---|---|
notify_templates table |
Stores reusable notification templates that contain trigger conditions based on date and status criteria. Also stores email contents and recipients. Email contents (subject and body) are stored as foreign keys to the messages table, which stores translatable strings that can contain embedded database field value references. A notification template contains almost everything necessary for a notification, except for the action/event item itself that the notification is about. Often, the same notification parameters (trigger conditions, email contents, recipients) are needed for multiple similar or recurring actions/events. By creating a single template, you can use it for as many action/event items as necessary, instead of duplicating the same trigger conditions, email contents, and recipients each time. |
notify_templates Table . |
notifications table | This is where you create an actual notification by associating a notification template record with an action/event record. You create a new notification for any task or event (activity_log record) by simply creating a new record in the notifications table containing a notification template ID (Foreign Key to notify_templates table) and an Action Item ID (Foreign Key to activity_log table). This establishes the relationship between the task/event for which you want a notification, and the notification template containing the settings (trigger conditions, email contents, and recipients) for the notification. | notifications Table |
notifycat table | Optionally create notification category names to assign to notification templates in order to organize (filter/find) notifications by its template’s category. | notifycat Table. |
ScheduledNotificationService workflow rule WFR | Runs on a schedule and sends the emails for each active notifications table record where the referenced task/event meets the trigger conditions defined in its associated notification template. | ScheduldedNotificationService workflow rule. |
messages table |
Stores translatable strings and supports embedded database field value references. The notify_templates table can reference these strings for use as email subject and body text. For each notification template record, you must create a messages table record for the email body text and reference it in notify_templates table. Optionally, you can also create and reference a messages table record for the email subject text. The strings in the table (in the message_text field and associated translatable fields) may contain references to database table fields. Any field references are dynamically replaced with the current value of the field at the time the email is sent. The field reference must be in the following format:
[${table.field}]
. For example, a message string with field references is:
Event [${activity_log.action_title}] is scheduled to begin on [${activity_log.date_scheduled}]
The strings are processed by the FreeMarker API, so they may contain a rich syntax that allows for various features beyond database table field references. When creating records in the messages table that use any FreeMarker syntax, including database field references, make sure to set the “Is Rich Text Format” field value to Yes |
|
activity_log table |
Contains the action/event/task records for which to send notifications. The date and status based trigger conditions in the notification template are based on date and status fields in the activity_log table. The date-based and status- based trigger conditions in the notification template are from the date and status fields in the activity_log table, e.g. status, date_scheduled, date_scheduled_end, date_required,date_started, date_completed, date_verified, date_closed. You can reference any activity_log field in the SQL-based trigger condition fields of the notify_templates table:
trigger_condition_from and trigger_condition_to
.
|
Comparison with Service Desk SLA Notifications
- SLA Notifications are used in conjunction with Service/Work Request routing and escalations. Scheduled Notifications are generic and flexible enough to be implemented for use cases in many activities.
- SLA Notifications provide trigger criteria that are tailored for Service/Work Request use cases. Scheduled Notifications provide configurable trigger criteria based on status, dates, and generic SQL clauses.
- SLA Notifications support subject/body message templates and recipient lists that are relevant to Service Desk. Scheduled Notifications support configurable subject/body message templates, recipient lists, and multiple resends.
.