laravel-slack icon indicating copy to clipboard operation
laravel-slack copied to clipboard

Sending to multiple channels from one webhook URL

Open tigran-cl opened this issue 5 years ago • 7 comments

Hi there, awesome job on the package, have a question for you.. In your examples you are able to send to different slack channels, for me, one webhook url, only allows me to send to a single channel. Specifying the channel in the to() function has no effect for me, it still sends it to the channel associated with the webhook url.

So I guess my question is, how did you generate your webhook url on slack so that you are able to send to multiple channels using a single webhook url? It doesn't seem possible from what I've found on google, it seems like you need a unique webhook url for each channel.

tigran-cl avatar Sep 26 '18 16:09 tigran-cl

Seems Slack removed this option.

https://api.slack.com/custom-integrations/incoming-webhooks#migrating_from_legacy_incoming_webhooks

henriqueramos avatar Oct 18 '18 22:10 henriqueramos

Is not possible to add multiple slack incoming webhooks?

gianemi2 avatar Nov 08 '18 09:11 gianemi2

@gianemi2 it is possible, I ended up forking this package so that I can point a channel to a webhook url in the config file. My only use case was to send to different channels though, I haven't tested sending to users and other stuff so use at your own risk... https://github.com/tigran-cl/laravel-slack

tigran-cl avatar Nov 08 '18 16:11 tigran-cl

Nice work. @tigran-cl Can you make a pull request?

tranghaviet avatar Dec 07 '18 09:12 tranghaviet

Channel Override Incoming webhooks have a default channel, but it can be overridden in your JSON payload. A public channel can be specified with "channel": "#other-channel", and a Direct Message with "channel": "@username".

When creating a webhook

freynolds avatar Apr 10 '19 20:04 freynolds

@freynolds that is a legacy option and does not work with new integrations.

https://api.slack.com/custom-integrations/incoming-webhooks

roerjo avatar May 17 '19 02:05 roerjo

@gianemi2 it is possible, I ended up forking this package so that I can point a channel to a webhook url in the config file. My only use case was to send to different channels though, I haven't tested sending to users and other stuff so use at your own risk... https://github.com/tigran-cl/laravel-slack

@tigran-cl Given that Slack only allows you to send to one channel (or user) per webhook, this package needs the ability to configure multiple webhook URLs, so that I can send a slack message to #my-channel or @my-user using one package. Can you please create a pull request?

connecteev avatar Jun 14 '19 19:06 connecteev