Slack
This is a step-by-step guide to integrate and send notifications to users on Slack.
Prerequisites
For sending notifications through Slack, you’ll need to create a Slack App. This App will basically be responsible for sending notifications to users / channels in their Slack workspace. To create Slack App, you’ll need a Slack account and a Slack workspace where you’ll be configuring the App. You will also need permission to create a Slack app. If you do not have access already, you can create your own free Slack workspace.
What all is covered here?
In this documentation, we’ll create an app to send direct messages to users or channels in a slack workspace. Here’s an overview of the steps required to integrate and send messages to a slack workspace:
-
Enable Slack Channel on SuprSend Platform
-
Create Slack App - You’ll use this app to send direct messages to a user or channel
-
Building OAuth flow to get the user permission and access token to send them notifications. This information will be stored as user’s slack channel information. Unlike email where if you know user’s email id, you can send email to that user. In case of Slack, your users have to authenticate and allow your app to send them notifications on Slack.
By following the above steps, your Slack integration will be setup. The next steps will be to
-
Update slack channel information in user or channel profile to send message
-
Create a Slack template and trigger workflow
This is how you get started:
Enable Slack Channel on SuprSend vendor page
Go to SuprSend dashboard -> Slack Vendor Settings page. Enable Slack channel
Create Slack App
You’ll need to create a Slack app and assign required OAuth Scopes to that App to send notifications via SuprSend. If you have an existing Slack app, you can directly go to OAuth Scopes.
Sign in to Slack.
Navigate to Apps page and click on “Create New App” button
Select Create an App "From scratch"
Give your App a suitable name
Give your App a suitable name and select the workspace you will be using to develop this app. For your test app, you can use something like “SuprSend Test App” for app name
Assign OAuth Scopes to App
OAuth is a protocol that lets your app request authorization to private details in a user’s Slack account without getting their password. It’s also the vehicle by which Slack apps are installed on a team. You can authorize your app using one of the below methods:
Update slack channel in user / object profile
The information required in the user profile is dependent on the type of message you are sending.
Order of Precedence
The Slack profile should only contain incoming_webhook->url
, or the access_token
with one of these keys: channel_id
, user_id
, or email
. If there are multiple keys in user.add_slack()
call, the order of precedence is as follows:
incoming_webhook->url
> channel_id
> user_id
> email
. For example, if your add_slack argument is as follows:
The profile will be saved as {"incoming_webhook": { "url": "https://hooks.slack.com/services/TXXXXXXXXX/BXXXXXXXX/XXXXXXXXXXXXXXXXXXX" } }
Update Slack Template
Refer section to create slack template using JSONNET editor.
Was this page helpful?