# 4.2.5.1.1 Informant and staff notifications

#### 📣 Notifications & Messaging in OpenCRVS

In a **production environment**, OpenCRVS sends automated notifications to **staff** and **informants** at key points in the registration workflow.\
In **development** and **QA environments**, messages are *disabled by default* to prevent accidental delivery.

You can fully customise:

* Supported communication channels (Email, SMS, WhatsApp, etc.)
* Message languages and localisation
* Message content and frequency
* Integration providers (e.g., Infobip, SendGrid)

The Farajaland example includes:

* **SMS integration** using *Infobip*
* **Email integration** using *SendGrid*

***

#### 🔁 Event Notification Flow

All event-related notifications pass through the [**`onAnyActionHandler`**](https://github.com/opencrvs/opencrvs-countryconfig/blob/0fc50a9d21d2c7525e5b8e3b8f1cd7c0ca7a7328/src/index.ts#L657) endpoint in *countryconfig*.\
This handler is triggered whenever an event changes status (e.g., **VALIDATED → REGISTERED**).

From this handler, the logic routes into a shared [**`notify`**](https://github.com/opencrvs/opencrvs-countryconfig/blob/0fc50a9d21d2c7525e5b8e3b8f1cd7c0ca7a7328/src/api/notification/handler.ts#L143) method where you can:

* Decide which messages to send
* Apply localisation
* Choose communication channels
* Customise timing or suppress notifications

This is the central place to configure message behaviour for your country implementation.

***

#### 📧 Email Templates

Email messages are written in **HTML** and can be fully customised.

* Templates are located in the email [templates](https://github.com/opencrvs/opencrvs-countryconfig/tree/develop/src/api/notification/email-templates) directory
* You may edit them to fit your country’s branding, tone, or regulatory requirements
* For each **custom event type** you introduce, you must create or modify a corresponding template
* The Farajaland configuration includes example templates for **birth**, **death**, and **marriage** events

***

#### 📱 SMS & WhatsApp Templates

SMS templates also support localisation and can be used for **SMS** or **WhatsApp** delivery.

* Templates are stored in the SMS templates [directory](https://github.com/opencrvs/opencrvs-countryconfig/blob/develop/src/translations/notification.csv)
* They are short-text, plain-language versions of notification messages
* For every **custom event type**, you must use or create a matching SMS template
* Farajaland provides sample templates for **birth**, **death**, and **marriage**

#### 📣 Essential staff communications

The following messages are sent to staff **by default**, as they are required for normal OpenCRVS operation.

\
By default, these notifications are delivered **via email**, but SMS equivalents can also be configured.

Below are example SMS versions of these essential staff messages:

<table><thead><tr><th width="142">Message</th><th>Description</th><th></th></tr></thead><tbody><tr><td>authenticationCodeNotification</td><td>Received by a staff member when logging in. Used to send the 2FA code for authentication during login <strong>REQUIRED IN PRODUCTION FOR SECURITY REASONS!!</strong> In <strong>development</strong> and <strong>qa</strong> environments, the 2FA code is always six zeros: 000000</td><td>Your OpenCRVS authentication code is: {{code}}</td></tr><tr><td>userCredentialsNotification</td><td>Received by a staff member when their OpenCRVS account has been created by a System Administrator</td><td>Your OpenCRVS account has been created. Please login with your username: {{username}} and temporary password: {{temporaryPassword}}</td></tr><tr><td>retrieveUserNameNotification</td><td>Received by staff when they have forgotten their username</td><td>Your username for OpenCRVS is: {{username}}</td></tr><tr><td>updateUserNameNotification</td><td>Received by staff when a System Administrator has changed their username</td><td>Your OpenCRVS username has been updated to: {{newUsername}}. Your password has not changed.</td></tr><tr><td>resetUserPasswordByAdminNotification</td><td>Received by staff when a System Administrator has changed their password</td><td>Your password has been reset. Please login to {{applicationName}} with the temporary password: {{temporaryPassword}}.</td></tr><tr><td>resetUserPasswordNotification</td><td>Received by staff when they attempt to reset their password</td><td>Use the code {{code}} to reset your {{applicationName}} password. This code expires in 10 minutes.</td></tr></tbody></table>

### Essential staff communication endpoints

All notifications related to staff pass through [these](https://github.com/opencrvs/opencrvs-countryconfig/blob/develop/src/config/routes/userNotificationRoutes.ts) routes and should only be carefully modified. Usually these will use Email by default.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://documentation.opencrvs.org/setup/3.-installation/3.2-set-up-your-own-country-configuration/3.2.5-set-up-application-settings/3.2.9.1-managing-language-content/3.3.3-provision-a-comms-gateway.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
