Multiple Slack Channels?
Hey π
Q - Is it possible to use Novu to send notification to multiple Slack channels?
Context: We want to use Novu to send alerts (as Slack messages) to users and have them be able to configure different channels for different alerts. From what I could tell when installing the Slack app, users need to choose one channel and thats the only channel that the app can then send messages to.
Thanks!
9 Replies
@tomer6321
Our current slack integration works on the webhookUrl.
When a user installs slack app, slack gives option to select channel or individual user. After selection and installation, slack generates a webhook url and this webhookUrl is stored in Novu
Yes I understand that. So then that means that for that particular user we can only send slack messages to that one channel that the user initially chose, correct?
@tomer6321 thanks for your time.
It helped in understand your requirements better.
As
webhookUrl
is attached to a subscriber. Multiple slack integrations can be added in one environment and be active at the same time.
one subscriber can have one webhookUrl
per slack integration.
if your userId is 12345
So you can create subscribers with subscriberId
12345_integration_1
12345_integration_2
12345_integration_3
like this
Each subscriber have credentials(webhookUrl) added for only one slack integration.
and that can be changed
checkout these links
1. https://docs.novu.co/api-reference/subscribers/update-subscriber-credentials
2. https://github.com/novuhq/novu/tree/next/packages/node#trigger-workflow-to-multiple-subscribers
Happy to know your thoughts about this approach πHey. Thanks for getting back to me.
I'm just reading through this. So you are saying that I would need to create a "fake" subscriber for every user<->integration pair, and I can then send the notification to whichever subscriber (or multiple using the link you just sent)
To further clarify, I would need to first create X slack integrations in Novu (X being the max number of channels I want to support). And each time that a user wants to add a new channel, I create a link for in the form of:
https://api.novu.co/v1/subscribers/<userId_integrationId>/credentials/slack/oauth?environmentId=environmentId&integrationIdentifier=<integrationId (that hasn't been used yet for this user)>
and they'll be redirected to your hosted auth page where they choose it from the list of available ones? (See attached picture)Perhaps this wasnt clear.
For this approach, how many slack integrations do I need to create in the Novu Integrations store?
if you want to support 4 channels for one subscriber then 4 slack integration need to be added
I see. Ok thanks
@tomer6321, you just advanced to level 1!
Let me know If you have any question or face any issue