Notifications in Discord

Last update: 13.12.2023

The general logic for setting up notifications about new cases and customer replies is described here. Other instructions:

To receive notifications in Discord, 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.

Getting the webhook URL in Discord

1. Select your server in Discord and open the settings for the channel where you want the notifications to arrive by clicking on the gearbox. Select the section "Integration" and the option "Create webhook".Go to the created webhook and copy the webhook URL.

cce8d054bcfe982c07703601c37f8b10.gif

You can also change the name you want to be displayed when you receive messages from Deskie and add your own avatar to make it easier to keep track of notifications in the channel. Remember to save your changes.

Сreating rules in Deskie

2. Create rules in Deskie to send notifications to Discord: Admin account → Channels → Rules subsection.

а. To receive notifications in Discord when new cases arrive, create a rule for new cases.

ff15bcc6010cac90c0749245b321cff0.png

In the "then perform actions" box, select the "Send webhook" option, then specify the POST method. In the "URL for sending request to" field, insert the webhook URL you copied in Discord. 

Choose the "Custom request" option below in JSON format and add the request code.

{
"embeds": [{
    "title": "#[case_number]: [case_subject]",
    "description": "*[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:

569b9f179efcfa02f759b1a5e77f6b2f.png

b) To receive notifications in Discord about new replies in chats and cases, create a rule for updated cases.

aea3b11554d98cb0ba22a9ad78e04c59.png

In the "then perform actions" box, select the "Send webhook" option, then specify the POST method. In the "URL for sending request to" field, insert the webhook URL you copied in Discord. 

Choose the "Custom request" option below in JSON format and add the request code.

{
"embeds": [{
    "title": "#[case_number]: [case_subject]",
    "description": "*[user_full_name]*: [user_email]\n\n[last_message|text]\n\n[Reply to a case]([case_url])"
 }]
}

A notification using the above code would look like this:

7713270ffd3314db75f47caa47b3afb5.png

This completes the notification setting. From now on you will receive notifications in Discord 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

3. You can flexibly set up notifications by creating different channels for them in Discord and specifying the necessary conditions in the rules on the Deskie side.

Examples of rules to send notifications.

a) inform the right agents (including those who do not have a Deskie account) about cases with a particular topic:

000d646bad242f312964f2bb9770cdb9.png

b) only send notifications from the "Billing" group to finance staff (a channel should be added to the "Billing" category in Discord):

626b8d02f060747081d39debd4cd905d.png

c) track the cases of a particular user:

1415b8ff7b58d4a0ec1e35212172758c.png

d) notify when the label was added:

db4fc4c18c74bd143338c26a894062f0.png

e) notify after the specified time has passed.

cd063643807fa6791808634bfc1e6b90.png

4. Add the variables you want with data from Deskie to the webhook code (case group, customer email, company, note's text, etc.) so that the notifications are as relevant as possible to your tasks.

5. Additional parameters in the webhook code will make your notifications even more informative. The webhook features in Discord are described in detail in the official documentation of the messenger.

Let's look at some options that may be useful when setting up notifications from Deskie. For example, you can use the following parameters:

  • "content" - to pass a case group through the variable;

  • "embed" - to send as an embed those data from the case that you would like to see in the notification;

  • The "color" parameter allows you to specify the design color of such an embed (the Decimal color model is used);

  • in the "author" block you can use parameters "name" and "icon_url" to pass different avatars and names (the "icon_url" parameter adds a link to any open source with images).

You can use different parameters in the text of webhooks for different automation rules in Deskie. For instance, in the webhook code, specify one value in the rule for new cases and another value in the rule for updated, to distinguish at a glance whether it is a new dialogue with a customer or a continuation of an old correspondence.

ae9e220e034b2825fa5df96cb398a197.png

Here is the webhook code with additional parameters that we used in our example:

a) for new cases:

{
"content": "[case_group]",
"embeds": [{
  "title": "#[case_number]: [case_subject]",
  "description": "*[user_full_name]*: [user_email]\n\n[case_description|text]\n\n[Reply to a case]([case_url])",
  "color": 36095,
  "author": {
    "name": "New case",
    "icon_url": "https://twemoji.maxcdn.com/v/13.1.0/72x72/1f3ab.png"
  }
 }]
}

b) for updated cases:

{
"content": "[case_group]",
"embeds": [{
  "title": "#[case_number]: [case_subject]",
  "description": "*[user_full_name]*: [user_email]\n\n[last_message|text]\n\n[Reply yo a case]([case_url])",
  "color": 15248186,
  "author": {
    "name": "New response in a case",
    "icon_url": "https://twemoji.maxcdn.com/v/13.1.0/72x72/1f4e9.png"
  }
 }]
}

Edit the code to suit your needs and paste it into the appropriate field when setting up rules to send notifications to Discord from Deskie.

6. Add a messenger mention via @user_ID to get extra attention from the assignee.

a. Get the agent ID:

Enable Developer mode via the User Settings — Advanced path. Then right-click on the user and click on "Copy user ID".

5aec7032dd36de581c13f86c4251d665.png

You can get your own ID in the settings under "My Account". See the Discord article for more information.

b. For each agent, create a rule for new cases that will send a notification in Discord mentioning the assignee when a new case arrives:

e4c64b3f988c4cafccb9c758e3319184.png

Use the following custom request text:

{
"content": "New case for <@[user_id]>",
"embeds": [{
    "title": "#[case_number]: [case_subject]",
  "description": "Priority: [case_priority]\n\n[case_description|text]\n\n[Reply to a case]([case_url])",
  "color": 36095
 }]
}

Here's an example of how it may look like:

608d347cf70a00b45025e2456323801a.png

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:

667e4f434deaa48eb598665878564595.png

c. To send a notification in Discord, 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:

65c7a39ce508cdd2ee265eb2a6841ab1.png

Use the following custom request text:

{
"content": "New reply in a case <@[user_id]>",
"embeds": [{
    "title": "#[case_number]: [case_subject]",
  "description": "Priority: [case_priority]\n\n[last_message|text]\n\n[Reply to a case]([case_url])",
  "color": 15248186
 }]
}

Please note that the variable [last_message|text] must be used to get the response text in the address parameter "text".

Here's an example of how it may look like:

6beac1e2eec89f301749fcbbfe5b1feb.png

Was this article helpful?