Session notifications
Table of Contents
Overview
This article describes how an admin, who manages Sessions, can send out notifications to students and faculties.
Note: This feature is available from v3.14 onwards.
Use case
An admin in charge of Sessions / timetabling wants to notify students and faculties when there are changes in their Session (e.g. change of time or venue).
The admin will need to make some changes (record updates) before the Session is finalized.
- This means that an automatic notification system is not ideal, as it will alert the audience every time a record is updated.
The admin wants to be able to notify the students and faculties only when everything is finalized.
So for example, once the admin has completed the changes, the admin can click on the dropdown menu for the Session, and send an announcement.
A popup will be displayed, where the admin can enter the notification details, and select the recipient, as well as the time they will receive it.
Once all is set, the admin can click on the “Send” button to trigger the notification to the targeted audience.
The notification will appear on both the internal and Digital Experience notification bell.
When users click on the notification, they will be redirected to the Announcement record page to view the announcement details.
Note:
The notification can also be sent out using these methods (not OOTB):
-
Via email.
-
This is not supported OOTB, and will require a custom flow to be built.
-
This is not supported OOTB, and will require a custom flow to be built.
-
Via WhatsApp and/or SMS.
- This is not supported OOTB, and will require integration with 3rd party apps.
Configuration
When the admin fills out the Announcement details and saves it, an Announcement record is created.
The apex class ANN_SendNotification_TDTM is used to send the notifications to the recipients, using Salesforce custom notification.
- RIO App Notification (API name = RIO_App_Notification).
The following attributes for the custom notification:
-
Notification Type Id:
-
The notification type id is default to the id of RIO_App_Notification custom notification.
-
The notification type id is default to the id of RIO_App_Notification custom notification.
-
Title:
-
The notification title will be the Announcement’s Name trimmed to 250 characters.
-
The notification title will be the Announcement’s Name trimmed to 250 characters.
-
Body:
- The notification body will be the Announcement’s Details.
-
Trimmed to 750 characters in plain text using the String.stripHtmlTags().
-
Sender Id:
- The notification sender will be the rio_ed__Notification_Sender_Id__c .
-
If it is blank, it should default to the current user.
-
Receivers Id:
- The rio_ed__Notification_Receivers_Id__c value needs to be split by using semi-colon (;) to become a Set of string.
- The limit is 500 unique ids.
-
The REDU_List_UTIL will split the list by 500 per list and send the notification based on that.
-
Target Id/Target Page Ref:
- The target page ref is based on the rio_ed__Notification_Target_Type__c that is selected.
-
There are 4 page ref types supported:
Page Ref Type | Sample JSON Payload |
Named Page (Experience Cloud) |
{ type: "comm__namedPage", attributes: { name: "<replace with Notification Target Value>" } } |
Named Page (Standard) |
{ type: "standard__namedPage", attributes: { name: "<replace with Notification Target Value>" } } |
Record Page | No page ref is required, use setTargetId() instead. |
Web Page |
{ "type": "standard__webPage", "attributes": { "url": ""<replace with Notification Target Value>" } } |
The class REDU_SessionSchedulerAnnouncement_LCTRL contains the following params:
Name | Description |
sessionId |
The session id. This is mapped to Announcement.Record_Id__c |
announcementSummary |
The announcement summary. This is mapped to Announcement.Name |
announcementDetails |
The announcement details. This is mapped to Announcement. |
notifyStudents |
If TRUE, the student Session Connection with Enrollment Status = Enrolled will be considered. The student user id is obtained from the User.ContactId field. |
notifyFaculties |
If TRUE, the faculty Session Connection with Enrollment Status = Enrolled will be considered. The faculty user id is obtained from the Contact.User__c. |
scStartDate |
For student: If this is defined, it will get Session Connections with Start Date >= scStartDate.
For faculty: If this is defined, it will get Session Connections that have attendance with Date >= scStartDate and Excused = FALSE. |
scEndDate |
For student: If this is defined, it will get Session Connections with End Date <= scEndDate.
For faculty: If this is defined, it will get Session Connections that have attendance with Date <= scEndDate and Excused = FALSE. |
Once the information is gathered, an announcement record will be created with the following mapping:
Field | Mapping |
Name | announcementSummary |
Details__c | announcementDetails |
Record_Id__c | sessionId |
Notification_Channel_Type__c | Notification |
Notification_Receivers_Id__c | Student and faculty user ids |
Notification_Receivers_Contact_Id__c | Student and faculty Contact ids |
Notification_Sender_Id__c | Current user id |
Notification_Target_Type__c | Record Page |
Notification_Target_Value__c | Blank |
Status__c | Active |