Notifying an agent mentioned in the note

Last update: 14.08.2023

When a note mentions a specific agent or group that the agent has access to, a mention icon appears in the header of their account.

4cb6b0fa30ab54aa1e760f669c78b946.png

However, if you think an agent will miss such a notification, or if you want them to react as quickly as possible, set up additional notifications via rules.

To keep track of mentions, there is a special condition in the rules for updated cases — "Note with mention of ... was added". You can use this to set up the logic you want without any problems. The options for this condition are as follows:

  • any agent;

  • any agent, who is available*;

  • any agent who is unavailable*;

  • an agent in a particular status;

  • certain agent;

  • certain group.

*An agent's availability is determined by access to cases and active chats in the status settings selected for the agent.

All actions that allow you to send notifications also have the necessary options:

  • send email to agents (mentioned in the note),

  • send email to groups (mentioned in the note),

  • send sound/browser notification to (agents, who have been mentioned in the note; groups, that have been mentioned in the note),

  • send webhook — this option allows you to set up sending notifications to your usual messenger or other third-party service.

Let's look at how to set up such notifications using actual examples:

1. Email, sound or browser notification

2.
 Sending notifications to messengers:

1. Email, sound or browser notification

To send an email, sound, or browser notification, set up the appropriate rules for updated cases. We've covered some popular scenarios in the examples, but you can customise the rules to suit your workflow:

  • combine multiple notifications in one rule, for example, send both browser and sound notifications;

  • add additional conditions to trigger the rule - by priority, group, etc..;

  • take into account the status of employees and access to a particular group.

а. A sound notification when any agent is mentioned in a note:

363f52165cc8b78f692749ad0c9fcb20.png

b. Browser notification when an agent is mentioned in cases with critical priority:

6bf513a75c89cdb504269e5626a44d4e.png

с. Send a notification to the email when mentioning an agent who is not available at the moment:

e185cb36bb6cb5576a56c4e11c46178f.png

d. Send a browser and sound notification when a note mentions agents in statuses that suggest the agent is at a workplace or will soon return after a short absence:

26a43b4d264154b274c0188d37a01e2d.png

2. Sending notifications to messengers

Create a rule for updated cases with the conditions you want, but the key one should be "Note with mention of ... was added".

In the actions, select "execute webhook" and specify the parameters that your chosen messenger or service expects to receive. Usually, when it comes to sending notifications, you need the POST method, then select "custom request" and specify its format (the most common is JSON).

Schematically, such a rule will look like this (substitute your values instead of the data specified in square brackets)

931eddb77a074e48fb37e835662e19bc.png

We have prepared instructions on how to get a webhook-URL and sample request code for the most popular messengers:

If you want to send notifications to a messenger that is not on the list, you will need to study the documentation of the receiving party yourself.

Telegram notifications

To receive notifications in Telegram, you must first create a separate Telegram bot to send such notifications. You can use the same bot to send notifications to different agents or groups in various situations. You will use the same webhook-URL in all rules that send such notifications. Only the conditions for triggering the rules and the Chat-ID of the recipient in the request code will change.

The process of creating a bot and getting the webhook-URL and Chat-ID is described in detail in this article.

Please note that you cannot use a bot that you have connected to Deskie as a communication channel with your customers to send notifications.

When the bot is ready, create a rule for updated cases in Deskie, which will send a webhook when a tracked event occurs — in our case, when an agent is mentioned in a note:

98cdf41544fbfa5f8182e582a9445a7b.png

In the "perform actions" block, select the "Send webhook" option, then specify the POST method.

In the "URL for sening  request to" box, specify a link:

https://api.telegram.org/bot[bot_token]/sendMessage

Replace the [bot_token] variable along with the brackets with your bot's API token.

Below, select the "Custom Request" option in JSON format and add the request code with the variables you need. Replace the [received_id] variable along with the brackets with the Chat-ID of the recipient — a specific Telegram user or group.

{
  "chat_id": [received_id],
  "parse_mode": "HTML",
  "text": "New mention in a note:\n\n<i>«[note_text]»</i>\n\n<b>#[case_number]: [case_subject]</b> \n[user_full_name]: [user_email]\n\n[last_message|text]",
  "disable_web_page_preview": "True",
  "reply_markup" : {
       "inline_keyboard": [
       [{"text":"Reply", "url":"[case_url]"}]
     ] 
  }
}

Here is how such a notification will look like in Telegram:

ec26c8673b9ba069a5947b1e6c3c6cb3.png

Slack notifications

To receive notifications about a mention in a note in Slack, you need to first create an app in Slack itself. How to do this is described in detail here.

Then add a rule in Deskie for updated cases with the conditions you need, the key one being "Note with mention of ... was added". In the actions, specify "Send webhook" and the POST method. Below that, select "Custom request" in JSON format.

ecab08dab9798f97764b1d77d960d96f.png

In the "URL for sending request to" field, specify the webhook-URL of your Slack app, then paste the following code into the custom request text field:

{
        "text": "New mention in a note: «[note_text]»",
        "blocks": [
            {
            "type": "context",
            "elements": [
                {
                    "type": "mrkdwn",
                    "text": "New *mention* in a note:"
                }
            ]
        },
        {
            "type": "section",
            "text": {
                "type": "mrkdwn",
                "text": ":spiral_note_pad: *_«[note_text]»_*"
            }
        },
        {
            "type": "divider"
        },
        {
            "type": "section",
            "fields": [
                {
                    "type": "mrkdwn",
                    "text": "*User*\n[user_full_name] \n [user_email]"
                },
                {
                    "type": "mrkdwn",
                    "text": "*Group*\n[case_group]"
                }
            ]
        },
        {
            "type": "section",
            "text": {
                "type": "mrkdwn",
                "text": "*№ <[case_url] | [case_number]>: [case_subject]*\n\n[last_message|text]"
            }
        },
        {
            "type": "divider"
        }
    ]
}

 Here is how such a notification will look like in Slack:

c8431df95c2a1b0edfb5cbb0b9224899.png

PRO hint: You can add a mention of an agent in the messenger itself to the custom request, so that the notification will definitely reach the recipient. For example, replace the "text" string in the "elements" parameter with the following:

"text": "<@[username or user id]>\n New *notification* in a note:"https://api.telegram.org/bot[bot_token]/sendMessage

Instead of square brackets, insert the agent's username or user id. To get a user id in Slack, just click on any user — a profile will appear in the sidebar, where you should select three dots and click on "Copy member ID".

An example of displaying such a notification:

de259c10430c49fe02de44657fe635ef.png

Mattermost notifications

To receive notifications in Mattermost when a note with a mention is added, you must first create an incoming webhook on the Mattermost server and copy the provided URL. There is a detailed instruction on how to do it here.

Then create a rule in Deskie, specifying the conditions you need + "Note with mention of ... was added" in the conditions.

93a2f0c8bdde0c070b0a90d1d73ec197.png

In the actions to be performed by the rule, select "Send Webhook" and the POST method. Paste the webhook-URL received in Mattermost into the appropriate field, select the custom request and specify the JSON format.

Use the following text for the custom request:

{
    "attachments":[
        {
        "fallback": "New mention in a note: «[note_text|text]»",
        "pretext": "New **mention** in a note:\n\n:spiral_note_pad: ***«[note_text|text]»***",
        "title": "№ [case_number]",
        "title_link": "[case_url]",
        "color": "#FFF140",
         "fields":[
            { 
                "short": true,
                "title": "Sender",
                "value": "[user_full_name] ([user_email])"
            },
            {  
                "short": true,
                "title": "Group",
                "value": "[case_group]"
            },
            {
                "short": false,
                "title": "[case_subject]",
                "value": "[last_message|text]"
            }
         ]
      }
   ]
}

Here is how it is going to look like in Mattermost:

e4c954cd5da3fdfd0068d7c3467c82f9.png

PRO hint: You can add a mention of an agent in the messenger itself to the custom request, so that the notification will definitely reach the recipient. To achieve that replace the string in "pretext" parameter:

"pretext": "@[username]\nNew **mention** in a note:\n\n:spiral_note_pad: ***«[note_text|text]»***",

In place of the square brackets, insert the username of the agent in Mattermost..

An example of such a notification:

ee31a3ea6729b11728e70134a15f9e79.png

Discord notifications

To receive notifications in Discord when mentioned in a note, you must first create an incoming webhook in your server channel and copy the provided URL. How to do this is described in detail here.

Then create a rule in Deskie with the conditions you need, among which should definitely include: "Note with mention of ... was added". In the actions, specify "Send webhook" and POST method. Below, select "Custom request" in JSON format.

506a5a3a4879947e99b57acda74f708b.png

In the custom request text field, paste this code:

{
"content": "[New mention in a note]([case_url]):\n:notepad_spiral: *_«[note_text|text]»_*",
"embeds": [{
  "title": "#[case_number]: [case_subject]",
  "description": "*[user_full_name]*: [user_email]\n\n[last_message|text]",
  "color": 16773440,
  "author": {
    "name": "[case_group]"
  }
 }]
}

An example of such a notification in Discord:

a7361245b4a2a03dc730da65788c8b83.png

PRO hint: You can add a mention of the employee in a custom request to ensure that the notification reaches the recipient for sure. For example, replace the "content" parameter string::

"content": "<@[user_ID]>\n[New mention in a note]([case_url]):\n:notepad_spiral: *_«[note_text|text]»_*",

After "@" insert the 18-digit user id in Discord, replacing it with the text [user_ID] along with square brackets. How to get the user ID in Discord is described in the messenger's instructions.

An example of such a notification:

bc89a5a7fc8ea48406f6eec17ff25fe1.png

Was this article helpful?