Skip to content

Notifications

Dylan Barkowsky edited this page Sep 12, 2024 · 19 revisions

Notifications

PIMS requires the ability to send email notifications to users and agencies based on specific internal events. The most common type of notification is to agencies to inform them of properties that are approved for the Enhanced Referral Program (ERP).

To support email notifications, PIMS maintains a list of notification templates in the database that correspond to the various kinds of emails needed. The majority of notifications are stored the database, but some notifications that are unlikely to require edits by Administrators are simply stored in code as Nunjucks templates. Backups of the database notifications are also stored as Nunjucks templates.

These notifications are sent based on specific events during the Disposal Project process. For example, when a user submits a new Disposal project, a New Disposal Project Submitted notification is constructed using the appropriate template and the relevant project information.

When a new project gets approved for ERP, notifications will be sent to all parent agencies that are set to receive notifications as well as the agency that created the project. Additional notifications are queued for sending at the 30, 60, and 90-day marks.

These notifications are sent via the Common Hosted Email Service (CHES). Requests sent to CHES include all the email parameters, including the delay time. They can then be queried from CHES as needed to retrieve updated status or to cancel pending emails.

All configuration for CHES is done through the .env file. Please see the README file for /express-api for more information on how to set these environment variables.

To see the available API endpoints related to notifications in PIMS, visit the Swagger page.

For more information on how the database handles these notifications, visit the Database page.

Workflow

Clone this wiki locally