---
title: "Messaging"
canonical: "https://red-ant-documentation.refined.site/space/RET/33914881/Messaging"
format: markdown
---
## Overview

The Messaging app can support the sending and receiving of [emails](https://redantdigital.atlassian.net/wiki/spaces/RET/pages/228032537), [SMS](https://redantdigital.atlassian.net/wiki/spaces/RET/pages/240222233), and [WhatsApp](https://redantdigital.atlassian.net/wiki/spaces/RET/pages/294158367) messages to and from customers - this can be used by sales associates to follow up post-purchase / consultation, share products, looks, send invitations to events, or simply send a birthday message.

Sales associates can utilise pre-defined, pre-formatted templates to draft replies and attach media to their communications to engage with their customers.

## Communication channel comparison

| **Feature** | <span style="color: #ff5630">**Email**</span> | <span style="color: #ff5630">**SMS**</span> | <span style="color: #ff5630">**WhatsApp**</span> | **Additional Info** |
| --- | --- | --- | --- | --- |
| Grouped into conversation threads | Yes | No | Yes | Email: Each topic or conversation with a customer is grouped into its own thread.<br>SMS: Currently each message from a customer is treated as a standalone conversation.<br>WhatsApp: All messages sent (by one or many sales associates) and received to a specific customer are grouped into a single conversation thread. |
| Can reply to customers from within conversation thread | Yes | No | Yes | SMS: User must go through ‘Create new message’ route to send a new reply. |
| Send customer templated messages | Yes | Yes | Yes | Email / SMS: User can select from a list of pre-defined templates. User can choose to overtype the message body to create a more personalised message.<br>WhatsApp: User must select from a list of pre-defined, pre-formatted text that must be pre-approved by Meta before it can be used to start a conversation. |
| Send customer free-form messages | Yes | Yes | Yes | WhatsApp: User can only send free-form messages when conversation window is open. |
| Send customer - Products from the catalogue | Yes | Yes | Yes | WhatsApp: User can only send attachments when conversation window is open. |
| Send customer - Uploaded imagery | Yes | Yes | Yes | WhatsApp: User can only send attachments when conversation window is open. |
| Send customer - Link(s) | Yes | Yes | Yes | Email / SMS: User can copy and paste a URL into the body of the message.<br>WhatsApp: User can copy and paste a URL into the body of a free-form message. |
| Preview message before sending | Yes | Yes | Yes | WhatsApp - The preview does not display any interactive buttons that might be associated with the selected message template. |
| Receive image(s) from customer | Yes | No | Yes | Email/WhatsApp - Media attachments are stored against the inbound message within the associated conversation thread. |
| Receive message reactions from customer | N/A | Yes | Yes | SMS: User will receive a notification of this reply and the reaction will be logged as a new message.<br>WhatsApp: User will receive a notification of this reply and the reaction will be logged as a new message in the associated thread. |
| Save the message as a draft | Yes | Yes | Yes | Draft messages are stored locally on the device where they were created. This means that if a user logs into the platform from a different device, their drafts will not be visible. Likewise, if multiple users share the same device, any saved drafts will be visible to all users accessing the platform on that device. |
| Attempt to resend a failed message | Yes | Yes | Yes | This is particularly useful in cases where the failure may have been caused by a temporary issue with a third-party provider (e.g., Meta). It’s important to note that the failed message cannot be edited—retrying simply re-attempts sending the original message content. |
| Message SLA | Yes | Yes | Yes | Default configurations:<br>- **Email:** SLA = 48 hours
- **SMS:** SLA = 24 hours
- **WhatsApp:** SLA = 24 hours
- **Reminder notification:** 10 hours before SLA breach |

> ℹ️ Whilst Messaging is primarily designed for personalised, 1-2-1 communication between a sales associate and a customer, as an optional add-on, the Messaging app can support sending messages to more than one customer simultaneously. More information on Multi Messaging can be found [here](https://redantdigital.atlassian.net/wiki/spaces/RET/pages/827752478).

## Data Structure

<details>
<summary>Messages - Data Structure</summary>

| **Field** | **Definition** | **Format / Additional Info** |
| --- | --- | --- |
| `id` | The unique message ID |  |
| `communicationType` | The communication channel used to send the message | `email` / `sms` / `whatsapp`<br>Where the `communicationType` is set to '`error`' this indicates that a message failed to send to the customer |
| `details` | This includes communication-channel specific information. All messages will include the contents of the message ('`text`'), links to any `attachments` and a reference to which `templateID` was used to reply to the customer | Emails will include refeference to the `subject` line<br>SMS / WhatsApp messages can include message `reaction`<br>Where the message is recorded as an `error`, details of the error include the error code will be recorded within the `details`, for example<br>`{`  
`  "code": 21211,`  
`  "text": "The 'To' number +445400000000 is not a valid phone number."`  
`}` |
| `userID` | The user who sent / received the message |  |
| `customerId` | The customer who sent / received the message |  |
| `fromCustomer` | Defines whether the message was sent (or received) by the customer | Boolean - `TRUE` / `FALSE` |
| `storeId` | The ID of the store that the user was logged into at the time they sent the message |  |
| `flagId` | A unique ID that corresponds with the `id` found within the associated flagged message entry |  |
| `updateSource` | The last application to update the record | Alphanumeric string |
| `messageId` | The unique ID returned from the customers email client / WhatsApp.<br>`messageID` is recorded on outbound messages.<br>When the customer replies via email, we use the `in-reply-to` header of the email to identify the original outgoing message, and hence the related customer record. |  |
| `threadId` | The ID which ties a group of email / WhatsApp messages together | For email, each thread with a customer will have its own unique `threadID`<br>For WhatsApp the `threadID` will be the customers telephone number |
| `readAt` | The date and time on which the message was opened by a user | Timestamp including timezone - for example `2023-03-09 16:34:22.267+00` |
</details>

<details>
<summary>Flagged Messages - Data Structure</summary>

| **Field** | **Definition** | **Format / Additional Info** |
| --- | --- | --- |
| `id` | A unique ID that corresponds with the `flagID` found within the associated message entry |  |
| `userId` | The user who flagged the message as inappropriate |  |
</details>

<details>
<summary>Message Templates - Data Structure</summary>

| **Field** | **Definition** | **Format / Additional Info** |
| --- | --- | --- |
| `name` | The name of the template as it will appear in the dropdown in the message composer screen |  |
| `commsType` | An internal reference to the type of communication |  |
| `file` | Link to the HTML template |  |
| `config` | This includes any template specific detail, including the `fromName` (i.e. the name of sender as it will appear to the recipient), `subject` line (incl. any dynamic variables) and `prefillBody` content |  |
| `metadata` | Our system-generated emails are typically triggered based on order type and status. Therefore, we can use the V2 `ConditionalTemplatedOrder` which selects the appropriate template to send from the `messageTemplates` table based on the configuration set on the template's metadata. | For example, setting a message template with the following configuration should trigger an email for an order complete.<br>`{`  
`  "orderConditionals": {`  
`    "toStatus": [`  
`      "complete"`  
`    ],`  
`    "orderType": "standard"`  
`  }` |
| `language` | The language that the template has been translated into.<br>This templates are grouped by language in the template dropdown within the message composer | Must be a valid [locale ID](https://learn.microsoft.com/en-us/openspecs/office_standards/ms-oe376/6c085406-a698-4e12-9d4d-c3b0ee3dbc4a) |
| `externalTemplateId` | As replies to email threads do not allow template selection, a default template can be set via the `externalTemplateId` field which will be used for all replies |  |
| `communicationsChannel` | This can be used to associate specific templates to a single or a group of communication channels (e.g. `email` / `sms`)<br>This will control which templates are shown in the dropdown within the message composer |  |
</details>

> ℹ️ We do not store WhatsApp templates within the Message Templates table, these are fetched directly from WhatsApp via their Cloud API. Only pre-approved templates will appear in the dropdown within the message composer. More information on WhatsApp templates can be found [here](https://redantdigital.atlassian.net/wiki/spaces/RET/pages/294158367/WhatsApp+Messaging#Message-Templates).

## Learn More

- [Email Messaging](https://redantdigital.atlassian.net/wiki/spaces/RET/pages/228032537)
- [SMS Messaging](https://redantdigital.atlassian.net/wiki/spaces/RET/pages/240222233)
- [WhatsApp Messaging](https://redantdigital.atlassian.net/wiki/spaces/RET/pages/294158367)
- [Multi Messaging](https://redantdigital.atlassian.net/wiki/spaces/RET/pages/827752478)