Note: This guide was originally written for the Strapi-based notification system. The notification system has since been migrated to JARB. The general concepts still apply, but code paths and configuration steps should be adapted to the JARB module structure.
Note: This article assumes that by "notification type", what is meant is referred
to as a trigger in the code base. There is a type field on the Notification model,
but that refers to how the notification is delivered (i.e. onsite or email). The
trigger field refers to the event that causes the user to be sent a notification.
NotificationConfigSetting model.WithRequired<Notification, '[field names]'>.
The field names should be strings separated by pipes |.imageUrl - The path for an image to be displayed next to the notification in the
drop down. This should be saved to the email folder in S3.text - The text that appears on the notificationtitle - The header that will be used in the email digestJust About Sandbox first and then pushed to Just About Production when it's ready.Notifications should be triggered within JARB. To trigger the notification, call the
triggerNotifications() service function in the notifications module.
The function takes the following parameters:
trigger - The indentifier set up for this notificationuser - The user instance to send the notification tosubject - A summary of the notification.params - An object of extra data to assign to the notification that can be used to
create the notification text. The following fields are permitted:
post - a Post objectbounty - a Bounty objectmembership - a Membership objectannouncement - an Announcement objectvars - a JSON-serializable object of arbitrary values that do not fit into the models listed above.