Creating your own Slack notification switch
Co-Founder, CEO
Support is full of moving parts — managing the queue, hunting down info, fixing problems, and reporting bugs. And did I mention managing the queue? But sometimes you're busy and not watching your Yetto inbox. Sometimes you're fixing someone's problem and don't want to keep checking on the queue but do need to know about new conversations. One streamlined way to make sure nothing falls through the cracks is to get a notification in a place where the whole team sees.
Slack is great for that — we can use Yetto's switch system to post to Slack whenever a customer creates a new conversation, and tweak the switch logic to make it useful for narrower cases.
Switches, not plugs
The basic workflow we'll use is an integration between Yetto and Slack. Yetto already has a Slack plug, but that's designed to let customers contact you in Slack directly, primarily in shared channels between your and your customers' workspaces. This Slack switch flips the script: it will notify Slack of any new activity in Yetto rather than pushing Slack threads into Yetto. Since this isn't the primary use case of the Slack plug, we'll use a switch to create a secondary connection that lets us push notifications into Slack. (Not sure what the difference is between a plug and a switch? There's a glossary for that!)
Note: In general, we don't recommend using Slack as a primary mode of communication between you and your customers. Yetto's Slack plug was built to reduce your time in a noisy chat environment and give you tools to organize customer conversations. But for some teams, Slack notifications can be a great way for everyone to see important activity.
Prepping Slack
Before creating the switch in Yetto, we need to get Slack ready to accept an incoming webhook so we have a place to send the Yetto notification that we'll create later. It's a four-step process that takes a few minutes to complete, and you can follow the instructions provided by Slack. Slack will prompt you to name your new Slack app; we named ours "Yetto notifier" so we know what it's for when looking through our authorized Slack apps.
In step three of Slack's process for creating the incoming webhook, you'll choose which Slack channel the Yetto notifications will post to. A "#support" channel is common for this, but a dedicated "#support-notifications" channel is great for keeping notifications organized (and keeping your main support channel from getting too noisy).
Once you do that, Slack will give you the webhook URL it's created for your channel. It'll look something like this:
https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX
Creating the Yetto switch
Now that you have a Slack webhook URL, create a switch in your Yetto organization. (All these instructions are also in the Yetto docs.) Go ahead and create a switch called "Slack notifications" with the following content, swapping out the URL below for the one you just got from Slack:
{
"version": "2023-03-06",
"events": {
"conversation.created": {
"actions": [
{
"name": "Slack notifications",
"uses": "http_request",
"to": {
"url": "https://hooks.slack.com/services/T000/B000/XXXX"
},
"with": {
"method": "POST"
"body": {
"text": "New conversation in Yetto!"
}
}
}
]
}
}
}
Breaking this down, you'll see that we've chosen the conversation.created event to trigger this switch. Each new conversation created in your Yetto inbox will initiate this switch, sending a message to Slack. The incoming webhook of the Slack app you created accepts POST requests, so we'll use that method in the http_request action.
You can have the switch post any text you want in Slack to let your team know that a new conversation has been created. We've used the simple and clear message "New conversation in Yetto!", but you can format the message however you like, or even link directly to your Yetto inbox using its static url — use this
https://web.yetto.app/orgs/ORG_NAME/inboxes/INBOX_NAME/conversations
and replace the ORG_NAME and INBOX_NAME with the ones you want to send people to.
That's it! Now when a new message is created in that inbox, your team gets a notification in Slack.
But wait… there's more
The world is your oyster here! Yetto's switches are flexible, and you can do a lot more than just notifying the team. You can add labels to conversations from high-priority customers, or only trigger notifications when a specific customer contacts you. Maybe you want notifications for every response to a conversation, not just every new conversation. Take a look at this short video for more on using switches to customize your workflow.
Switches are our way of customizing Yetto to your team and your workflows. Use them in whichever way works for you.
Are there more switch functions that'd be useful for your team? More actions or conditions? Let us know what you're trying to build; we're always looking for more feedback and ways to make your lives easier.
Happy helping!