The general logic for setting up notifications about new cases and customer replies is described here. Other instructions:
sound and browser notifications (2 minutes each to complete)
email notifications (2 minutes to complete)
notifications in Slack (10 minutes to complete)
notifications in Telegram (5 minutes to complete)
notifications in Discord (5 minutes to complete)
In Mattermost, you need to add an incoming webhook in the settings of the channel to which the notifications will be sent. Then create automation rules in Deskie to send notifications.
In the example we consider the option of sending all notifications to a separate channel, which we have created in advance in Mattermost and named Deskie Notifies.
Setting up the webhook in Mattermost
1. Ensure that your Mattermost server settings allow you to accept incoming webhooks. To do this, go to the menu under System Console → Integrations → Integration Management. The value of the "Enable incoming webhooks" option should be "true". If you do not have access to the system console, contact your administrator.
Integration permissions for overriding names and image icons will allow you to add arbitrary bot names and avatars. This makes it easier for you to differentiate notifications from Deskie among other correspondence in the channel. If you don't give these permissions, the notifications will appear in the name of the webhook creator and with his/her avatar. You can distinguish them from ordinary messages from the same user by the label "BOT". If these permissions are granted, there will be fields in the webhook settings to add the bot's own name and avatar, and the ability to pass the username and icon_url using a request directly in the webhook's code.
2. Go to the settings for the Mattermost channel to which you plan to receive notifications and configure the incoming webhook.
а. From the main menu, go to "Integrations", select the "Incoming webhooks" option and press "Add new webhook".
b. Fill in the suggested form and save your changes. Be sure to select only the channel you want the notifications to go to, you can leave the other fields blank.
c. Copy the URL of your incoming webhook.
Creating rules in Deskie
3. Create rules in Deskie to send notifications to Mattermost: Admin account → Channels → Rules subsection.
a. To receive Mattermost notifications about new cases, create a rule for new cases:
In the "then perform action" box select the "Send webhook" option, then specify the POST method. In the "URL for sending request to" box insert the webhook URL you copied from Mattermost.
Select the "Custom request" option below in JSON format and add the request code:
{"text":"**#[case_number]: [case_subject]**\n_[user_full_name]_: [user_email]\n\n[case_description|text]\n\n[reply to a case]([case_url])"}
You can use any variables you want in your text. For a complete list of available variables, see the "variables" link in the rule creation form itself.
A notification using the above code would look like this:
b. To receive notifications in Mattermost about new replies in chats and cases, create a rule for updated cases.
In the "then perform action" box select the "Send webhook" option, then specify the POST method. In the "URL for sending request to" box insert the webhook URL you copied from Mattermost.
Select the "Custom request" option below in JSON format and add the request code with the variables you require, similar to the rule for new cases from step 3a in this guide:
{"text":"**#[case_number]: [case_subject]**\n_[user_full_name]_: [user_email]\n\n[case_description|text]\n\n[reply to a case]([case_url])" }
A notification using the above code would look like this:
This completes the notification setting, you will now receive notifications in Mattermost and won't miss new messages from your customers.
PRO hint: In new chats, the case subject is formed based on the first message from the customer:
sometimes such a message can be quite long and break the layout of your notification;
the text of the message itself will then duplicate the subject.
To ensure this doesn't happen, it is better to create separate rules for new email-based cases and cases from synchronous channels and avoid using the [case_subject] variable in the request code for notifications about new chats.
Advanced features
4. You can flexibly set up notifications by creating different channels for them in Mattermost and by writing the right conditions in the rules on the Deskie side.
For example, you can send notifications from the "Billing" group only to agents in the finance department by adding a channel to the "Billing" category in Mattermost. You can inform the right agents (including those who don't have a Deskie account) when they receive a case with a specific subject, from a specific user, when a tag is added, etc.
5. The name and avatar of the user from whom the notifications will come, can be added either when setting up the incoming webhook in Mattermost when filling in the form in step 2b, or in the body of the webhook itself in Deskie. To do this, add the appropriate lines with username and icon_url to the text. In the examples we use the Deskie logo, you will need to specify the path to the image you want:
{"username":"Deskiebot", "icon_url":"[link to your iamge]", "text":"**#[case_number]: [case_subject]**\n_[user_full_name]_: [user_email]\n\n[case_description|text]\n\n[reply to a case]([case_url])"}
The option of specifying username and icon_url directly in the webhook code is handy if you want to visually differentiate notifications within the same channel.
An example of a rule for new VIP customer cases to distinguish them from other notifications.
6. Add a mention in the messenger. You can tag a desired agent or group of agents via @username, @channel, @all, @here, or @groupname. Read more in the Mattermost documentation.
If you want to mention the assignee, then you will require rules for the automatic distribution of cases and rules for each agent that will send a notification mentioning the assignee to Mattermost when a new case comes in.
а. An example of rules for new cases to send a notification mentioning an agent to Mattermost:
Use the following custom request text:
{ "username": "New case", "text":"**#[case_number]: [case_subject]**\n\n**Assignee**: @[username]\n**Priority**: [case_priority]\n\n[case_description|text]\n\n[reply to a case]([case_url])" }
Example of a display:
PRO hint: To add rules more quickly, use the clone function and then edit only the data of the agent mentioned in the rules. Combine the rules created for all agents into one group.
Place the created rule group after the rule which sets assignees in a case. For example, to evenly set available agents as assignees in cases, except the manager and those with "view-only" access, you can use a rule like this:
b. To send a notification in Mattermost, mentioning the assignee when a new response is received in a case, you will also need separate rules for updated cases for each agent, which we recommend grouping together. Here is an example of such a rule:
Use the following custom request text:
{ "username": "New reply in a case", "text":"**#[case_number]: [case_subject]**\n\n**Assignee**: @[username]\n**Priority**: [case_priority]\n\n[last_message|text]\n\n[reply to a case]([case_url])" }
Example of a display:
7. Send notifications directly to the agent so as not to overload the channels with unnecessary information. To do this, add the variable "channel" at the beginning of any code request after the first curly bracket: "@[username]":
{ "channel": "@[username]", "text":"**#[case_number]: [case_subject]**\n_[user_full_name]_: [user_email]\n\n[case_description|text]\n\n[reply to a case]([case_url])" }
The incoming webhook created in Step 2 must not be locked to a channel:
These notifications will be sent to the agent's private messages on behalf of the webhook creator. The webhook creator will also see the notifications received by the agent. The webhook creator cannot send notifications to itself, only to another user or to a channel it participates in. To send a notification to a channel, specify in the variable "channel": "[channel]" without @.
Example of a display: