--- title: "Notifications for Inbound Messages" slug: "notifications-for-inbound-messages" updated: 2026-08-27T16:25:53Z published: 2026-08-27T16:25:53Z canonical: "docs.natterbox.com/notifications-for-inbound-messages" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.natterbox.com/llms.txt > Use this file to discover all available pages before exploring further. # Notifications for Inbound Messages This guide is for creating a notification for an inbound message (SMS or WhatsApp) using task notifications. There is an out-the-box notification in the CTI but this guide is for a more obvious notification. This is what the out-the-box CTI notification looks like: ![Natterbox interface showing notifications for a new message](https://cdn.document360.io/c81c490c-daaa-4ebd-a3c3-1a2dee8b7617/Images/Documentation/Screenshot 2025-05-19 at 16.37.40.png) This is the notification you will get from implementing this guide: ![Notification indicating a new SMS received](https://cdn.document360.io/c81c490c-daaa-4ebd-a3c3-1a2dee8b7617/Images/Documentation/image-1747674756710.png) *(Or similar message)* > [!NOTE] > *Note: this works for both Freedom and SCV users with digital licences.* ### How to configure this: 1. Navigate to the Routing Policy tab. 2. Create a new routing policy that is a ‘Data Analytics’ policy. 3. ‘Click here to START’ and then select ‘Add Event’ ![](https://cdn.document360.io/c81c490c-daaa-4ebd-a3c3-1a2dee8b7617/Images/Documentation/Screenshot 2025-05-19 at 18.03.06.png) 4. Click into the blue container that appears, click ‘Select Event’ and then check ‘Inbound Message Publish’. 1. Leave the retry duration as the default. ![](https://cdn.document360.io/c81c490c-daaa-4ebd-a3c3-1a2dee8b7617/Images/Documentation/Screenshot 2025-05-19 at 18.05.05.png) 5. Add a new action container after the blue event container. 6. Add a script engine app inside the container 1. Name this item: Script for Time Now. 2. Lua Script: ```lua local dateTime = os.date("!%Y-%m-%dT%H:%M:%SZ") session.set('TimeNow', tostring(dateTime)) ``` ![](https://cdn.document360.io/c81c490c-daaa-4ebd-a3c3-1a2dee8b7617/Images/Documentation/Screenshot 2025-05-19 at 18.05.36.png) 7. Add a new action container and connect both the top and bottom container from the previous action container. 8. Add a ‘Query Object’ app 1. Name this item: Query NB User 2. Result Set: NBUser 3. Trigger When: ‘Records not found’ AND ‘Error Returned’ [‘Records found’ is not checked] 4. Record Type: Natterbox User 5. Filter Results: 1. Field: External Id 2. Operator: = 3. Value: $(Payload_Event.event.userId) 6. Return Fields: 1. Record ID 2. Salesforce User 7. Leave everything else as default. ![](https://cdn.document360.io/c81c490c-daaa-4ebd-a3c3-1a2dee8b7617/Images/Documentation/Screenshot 2025-05-19 at 18.07.02.png) 9. Add a ‘Create a Record’ app 1. Name this item: Create Task 2. Result Set: ‘MyData’ *[This is default. Usually it should be changed but because it’s not being used for anything else, this is not necessary].* 3. Trigger When: [Leave as default] 4. Record Type: Task 5. Owner ID: $(SForce_NBUser.nbavs__User__c) *This is the result of the query app.* 6. Set Field Values: 1. Description: $(Payload_Event.event.textPayload) *This is the message content.* 2. Due Date Only: $(Custom_TimeNow) 3. Reminder Date/Time: $(Custom_TimeNow) 4. Reminder Set: true 5. Subject: You have a new SMS! *Customise this message to your desire.* ![](https://cdn.document360.io/c81c490c-daaa-4ebd-a3c3-1a2dee8b7617/Images/Documentation/Screenshot 2025-05-19 at 18.07.50.png) 10. Save your policy! ![](https://cdn.document360.io/c81c490c-daaa-4ebd-a3c3-1a2dee8b7617/Images/Documentation/Screenshot 2025-05-19 at 18.04.10.png) 11. Optional: you could also look at adding in an email notification in addition or as an alternative to the task notification. 1. When querying the Natterbox User above, make sure to return ‘Email Address’ as well (step 8.f.). This will be the address for the email to be sent to 2. Add a ‘Notify’ app. It needs to be below the ‘Query NB User’ but above the ‘Create Task’ (if you are doing both). ![Flowchart illustrating event-driven actions including email notifications and task creation.](https://cdn.document360.io/c81c490c-daaa-4ebd-a3c3-1a2dee8b7617/Images/Documentation/Screenshot 2025-05-20 at 16.13.32.png) 3. Choose ‘Email’ and configure like this: 1. Send email on: All attempts 2. To Email Addresses: $(SForce_NBUser.nbavs__Username__c) [macro for the email address from the Natterbox User] 3. Subject: Inbound Message received 4. Email body: Text body: $(Payload_Event.event.textPayload) ![Configuration settings for email notifications including recipient details and subject line.](https://cdn.document360.io/c81c490c-daaa-4ebd-a3c3-1a2dee8b7617/Images/Documentation/Screenshot 2025-05-20 at 16.13.23.png) 12. Save the policy! Natterbox's newest user interface for voice communications that works within Salesforce, in a web browser, and on mobile. Service Cloud Voice An integration into Salesforce’s Service Cloud Voice app - Natterbox will act as the telephony provider for Service Cloud