10.0: Get notifications in Slack for new VIP messages using automations and connected accounts #15
jstanden
started this conversation in
Guides and Tutorials
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Introduction
Cerb can use real-time messaging platforms like Slack to send notifications to the right people.
This is particularly useful to quickly address new messages from VIPs like investors, executives, partners, or high-value clients.
In this example we'll create an automation that sends a summary for new ticket messages to a Slack channel.
This is a common real-world use case; but this example is also a great starting point for any other notifications you'd like to create. For instance, you can notify a
#security
channel when a worker account is locked from too many invalid password attempts.We'll be using the chat.postMessage method from Slack's API: https://api.slack.com/methods/chat.postMessage
Create a connected account for Slack
First, if you don't already have a Slack-based connected account in Cerb, follow these instructions to create one:
https://cerb.ai/guides/integrations/slack/
Import the package in Cerb
Navigate to Setup -> Packages -> Import.
Paste the following package:
Click the Import button.
Choose your Slack connected account from the first step above, and pick the channel you want to receive new message notifications.
Click the Import button again.
You should see the following new record:
Testing the automation
Hold
<SHIFT>
and click on the wgm.example.slack.email.notification bubble to edit the new automation.This automation will send a summary of a ticket message to the Slack channel.
Use an input like:
Where
message: 1
is the ID of a message in your system.If you're not sure what ID to use, navigate to any ticket profile page. Click on the permalink icon to the top right of a message:
The message ID is the last number in the URL:
Click the Run button in the automation editor:
You should receive a new message in your Slack channel:
Automating notifications for new inbound messages
Let's automate the new message notifications.
Navigate to Search -> Automation Events.
Edit the record.changed event.
Paste the following KATA:
Click the Save Changes button.
Test the event
Navigate to Setup -> Mail -> Incoming -> Import.
Paste a message like:
Click the Import button.
You should receive a new notification in Slack.
Conclusion
Now that you have a new Slack notification for each new message, you can filter the
record.changed
automation event to only notify you about certain messages (by sender, org, support level, etc).Beta Was this translation helpful? Give feedback.
All reactions