---
description: >-
  You can configure various notifications in your system to remind you of
  important activities.
---

# Notification

1. The completion date of a Task.
2. Expected Delivery Date of a Sales Order.
3. Expected Payment Date.
4. A reminder of follow up.
5. If an Order greater than a particular value is received or sent.
6. Expiry notification for a Contract.
7. Completion/Status change of a Task.

You can access **Notifications** via:                                                          Settings > Emails/Notifications > Notification                                        &#x20;

### 1. Setting Up An Alert                                                           <a href="#id-1-setting-up-an-alert" id="id-1-setting-up-an-alert"></a>

1. Select the Document Type you want to watch changes on.
2. Define what events you want to watch under Send Alert On. Events are:
   1. New: When a new document of the selected type is made.
   2. Save/Submit/Cancel: When a document of the selected type is saved, submitted, or canceled.
   3. Days Before/Days After: Trigger this alert a few days before or after the **Reference Date.** To set the days, set **Days Before or After**. This can be useful in reminding you of upcoming due dates or reminding you to follow up on certain leads of quotations.
   4. Value Change: When a particular value in the selected type changes.
   5. Method: Sends notification when a specific method is triggered. Eg: before\_insert.
   6. Custom: Send a notification to an [Email Account](../workflows/email/email-account) selected.
3. Set additional Conditions if required.
4. Set the recipients of this alert. The recipient could either be a field of the document or a list of fixed Email Addresses.
5. Compose the message.
6. Save.

#### 1.1 Setting a Subject                                                                                                  <a href="#id-11-setting-a-subject" id="id-11-setting-a-subject"></a>

1. &#x20;You can retrieve the data for a particular field by using `doc.[field_name]`.&#x20;
2. &#x20;To use it in your subject/message, you have to surround it with `{% raw %}{{ }}{% endraw %}`.
3. &#x20;These are called [Jinja](http://jinja.pocoo.org/) tags.
4. &#x20;For example, to get the name of a document, you use `{% raw %}{{ doc.name }}{% endraw %}`.&#x20;
5. The following example sends an email on saving a Task with the Subject, "TASK#### has been created"

![](https://429967333-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MgEi4gT9xOnYSAL1Pei%2F-MiQl5jsTvM8lS1_-E9F%2F-MiQoJqcNkL42-NGSrqb%2FNotification%201.png?alt=media\&token=641acf42-5b1b-41ac-9500-ec1e0c98bfd5)

#### 1.2 Setting Conditions[ ](https://docs.erpnext.com/docs/v13/user/manual/en/setting-up/notifications#12-setting-conditions)                                                                               <a href="#id-12-setting-conditions" id="id-12-setting-conditions"></a>

1. Notifications allow you to set conditions according to the field data in your documents.
2. &#x20;For example, if you want to receive an Email if a Lead has been saved as "Interested" as it's status, you put `doc.status == "Interested"` in the conditions textbox.
3. You can also set more complex conditions by combining them.

![](https://429967333-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MgEi4gT9xOnYSAL1Pei%2F-MiQl5jsTvM8lS1_-E9F%2F-MiQotCs7Y_PZv7zWXW4%2FNotification%202.png?alt=media\&token=99c80ede-fed0-4003-95a2-056661d6c538)

The above example will send a Notification when a Task is saved with the status "Open" and the "Expected End Date" for the Task is the date on or before the date on which it was saved on.

#### 1.3 Setting a Message <a href="#id-13-setting-a-message" id="id-13-setting-a-message"></a>

* &#x20;You can use both Jinja Tags (`{% raw %}{{ doc.[field_name] }}{% endraw %}`) and HTML tags in the message textbox.

#### 1.4 Setting a Value after the Alert is Set <a href="#id-14-setting-a-value-after-the-alert-is-set" id="id-14-setting-a-value-after-the-alert-is-set"></a>

* &#x20;Sometimes to make sure that the Notification is not sent multiple times, you can define a custom property (via Customize Form) like "Notification Sent" and then set this property after the alert is sent by setting the **Set Property After Alert** field.
* &#x20;Then you can use that as a condition in the **Condition** rules to ensure emails are not sent multiple times.

![](https://429967333-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MgEi4gT9xOnYSAL1Pei%2F-MiQl5jsTvM8lS1_-E9F%2F-MiQpkAKKnV9y3N2M9yv%2FNotification%203.png?alt=media\&token=fdaa08d9-ed44-41b3-9af5-22aecb1385c1)

#### 1.5 Example <a href="#id-15-example" id="id-15-example"></a>

1. Defining the Criteria

![](https://429967333-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MgEi4gT9xOnYSAL1Pei%2F-MiQl5jsTvM8lS1_-E9F%2F-MiQqGfi5T9nAb8lr4er%2FNotification%205.png?alt=media\&token=b9471cb5-11a8-4258-b3f6-146049c26986)

&#x20;   2\. Setting the Recipients and Message

![](https://429967333-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MgEi4gT9xOnYSAL1Pei%2F-MiQl5jsTvM8lS1_-E9F%2F-MiQqaANLvyhEefU2GWU%2FNotification%205.png?alt=media\&token=1dc56d87-d2c9-439f-8457-afc0332663d9)

### 2. Slack Notifications <a href="#id-2-slack-notifications" id="id-2-slack-notifications"></a>

* If you prefer to have your notifications sent to a dedicated Slack channel, you can also choose the option "Slack" in the channel options and select the appropriate Slack Webhook URL.

#### 2.1 Slack Webhook URL <a href="#id-21-slack-webhook-url" id="id-21-slack-webhook-url"></a>

* A Slack webhook URL is a URL pointing directly to a Slack channel.
* To generate webhook URLs, you need to create a new Slack App:
  1. Go to https://api.slack.com/slack-apps.
  2. Click on "Create a Slack App".

![](https://429967333-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MgEi4gT9xOnYSAL1Pei%2F-MiQl5jsTvM8lS1_-E9F%2F-MiQrmPYwKPCeaCrfwPq%2Fslack_notification_1.png?alt=media\&token=9376f325-11ce-4da7-970b-bb0aa2df8973)

* Give your App a name and choose the right workspace.
* Once your app is created, go to the "Incoming Webhooks" section and add a new Webhook to Workspace.

![](https://429967333-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MgEi4gT9xOnYSAL1Pei%2F-MiQl5jsTvM8lS1_-E9F%2F-MiQs6MvmvQl6LdKxBCs%2Fslack_notification_2.png?alt=media\&token=ed2c70d8-3ecf-489c-8cb4-caea1d45f5fe)

* Copy the created link, go back to ActiveBooks and use it to create a new Slack Webhook                                         URL in Integrations > Slack Webhook URL.

![](https://429967333-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MgEi4gT9xOnYSAL1Pei%2F-MiQl5jsTvM8lS1_-E9F%2F-MiQsTVKUwrYGcdCpX9T%2Fslack_notification_3.png?alt=media\&token=0dece916-f681-45cf-ac8c-15295d6bfd14)

* Select Slack and your Slack channel in the channel and Slack channel fields within your notification.

#### 2.2 Message Format <a href="#id-22-message-format" id="id-22-message-format"></a>

* Unlike Email messages, Slack doesn't allow HTML formatting.
* &#x20;Instead, you can use markdown formatting: Slack Documentation.
* &#x20;Example: \{% raw %\} _Order Overdue_

![](https://429967333-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MgEi4gT9xOnYSAL1Pei%2F-MiQl5jsTvM8lS1_-E9F%2F-MiQtBtgs0sScnwG6kJu%2Fslack_notification_4.png?alt=media\&token=cc45c9af-9929-4d5f-86da-abe62914f2b9)

### 3. System Notifications <a href="#id-3-system-notifications" id="id-3-system-notifications"></a>

* &#x20;In **Version 12** we introduced System notifications for **Assignments**, **mentions**, **documents shared**, and **Energy Points**.
* These notifications show up in the notifications dropdown on the the navigation bar's top right corner.
* &#x20;In **Version 13** we have introduced an additional channel to send alerts - **System Notifications**:

![](https://429967333-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MgEi4gT9xOnYSAL1Pei%2F-MiQl5jsTvM8lS1_-E9F%2F-MiQtdR0chxUEg3I8QZQ%2Fsystem-notifications-channel.png?alt=media\&token=7c0ce549-771a-49bc-94ea-532897de4b53)

* Choosing this channel will send a system notification when a notification is triggered, instead of an Email or a Slack notification.

![](https://429967333-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MgEi4gT9xOnYSAL1Pei%2F-MiQl5jsTvM8lS1_-E9F%2F-MiQtwjnKFMqYIivVUoE%2Fsystem-notification.png?alt=media\&token=36006773-61f4-4c75-920f-b12a43d38f0c)

* Clicking on the notification routes to the **Notification Log** document which contains the configured subject, message as well as the attached file, if Attach Print is set:

![](https://429967333-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MgEi4gT9xOnYSAL1Pei%2F-MiQl5jsTvM8lS1_-E9F%2F-MiQu_mTUZFPktp7cF5q%2Fnotification-log%20\(1\).png?alt=media\&token=2095cd6c-99b7-465b-bcd6-21df4edc5333)

* If Email/Slack alerts and System Notifications both are required, the main channel can be set as Email or Slack and this option can be checked:

![](https://429967333-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MgEi4gT9xOnYSAL1Pei%2F-MiQl5jsTvM8lS1_-E9F%2F-MiQuqcq5STlhxCjknJZ%2Fsend-system-notification.png?alt=media\&token=57b89c15-bed6-4b0f-8c0d-19fa50f47150)

### 4. WhatsApp <a href="#id-4-whatsapp" id="id-4-whatsapp"></a>

* &#x20;In **Version 13** we have introduced an additional channel to send alerts - **WhatsApp**:

![](https://429967333-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MgEi4gT9xOnYSAL1Pei%2F-MiQl5jsTvM8lS1_-E9F%2F-MiQvKel4veIe0cBZbyf%2Ftwilio-channel.png?alt=media\&token=fc8212dc-fce5-4560-87b6-4800781545df)

* If you prefer to have your notifications sent to a WhatsApp number, you can also choose the option "WhatsApp" in the channel options and select the appropriate Twilio Number.
* Twilio Numbers can be added to Twilio settings in Frappe. WhatsApp messages can only be sent to numbers which have country codes in them.

![](https://429967333-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MgEi4gT9xOnYSAL1Pei%2F-MiQl5jsTvM8lS1_-E9F%2F-MiQvgRg-YKzikevTb_t%2Ftwilio-settings.png?alt=media\&token=398436f2-2ed5-4bc3-b778-316cf549e10b)

#### 4.1 Twilio Settings <a href="#id-41-twilio-settings" id="id-41-twilio-settings"></a>

* In order to configure Twilio settings, you need to first obtain Twilio credentials from your Twilio Account's account settings.
* You can only add those phone numbers that have been activated in your Twilio Account with WhatsApp access.

![](https://429967333-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MgEi4gT9xOnYSAL1Pei%2F-MiQl5jsTvM8lS1_-E9F%2F-MiQw9K3DcqUpoXxUYxO%2Ftwilio-credentials.png?alt=media\&token=b0550261-bec1-4fe5-8187-dfa94cf3290a)

#### 4.2 Message Format <a href="#id-42-message-format" id="id-42-message-format"></a>

* WhatsApp allows their users to only send those message templates that are pre-approved by them to your customers.
* Failure to do so might result in restrictions on you Twilio account.

![](https://429967333-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MgEi4gT9xOnYSAL1Pei%2F-MiQl5jsTvM8lS1_-E9F%2F-MiQwWZ-bEoxgfacuu7U%2Ftwilio-pre-approved-message.png?alt=media\&token=66465aff-9939-4977-a502-f6dbb5524617)

### 5. SMS <a href="#id-5-sms" id="id-5-sms"></a>

* &#x20;In **Version 13** we have introduced an additional channel to send alerts - **SMS**:
* In order to use this channel, you would need to complete the configuration of [SMS Settings](sms-settings).



























































&#x20;                  &#x20;



