laravel / slack-notification-channel

Slack Notification Channel for laravel.
https://laravel.com/docs/notifications#slack-notifications
MIT License
865 stars 59 forks source link

[2.0] Included possibility to utilize Slack API instead of Slack webhooks #18

Closed lukasmu closed 5 years ago

lukasmu commented 5 years ago

Slack recently modified their incoming webhook functionalities. Unfortunately, now Slack messages can only be sent to a single channel (that needs to be specified when adding a Slack app to a Slack workspace).

In the Laravel docs it is stated that SlackMessage instances have a "to" method to specify the recipient (see https://laravel.com/docs/5.8/notifications#slack-notifications). However, due to the changes made by Slack, this method is not working any longer (the message is always sent to the channel specified).

Instead of using incoming webhooks one can also utilize the Slack API, more specifically the method "chat.postMessage" (see https://api.slack.com/methods/chat.postMessage). Using this method one overcomes the limitations of the incoming webhook functionalities.

The changes implemented in this pull request are fully backwards compatible:

taylorotwell commented 5 years ago

I don't think we plan to really modify or make more changes to this channel. We would be open to the community maintaining their own version of the channel with whatever improvements are needed.

nathanheffley commented 5 years ago

If you aren't planning to maintain this package to keep up with Slack API changes should the package be marked as unmaintained so people don't think it will keep up to date? This package is partially broken without this patch.

lukasmu commented 5 years ago

@taylorotwell What would be the best way to achieve your proposal? I have two ideas in mind. A) Making a fork, changing the composer config a bit, but keeping the Illuminate\Notifications namespace B) Copying the code to a completely new repository to align with the boilerplate from http://laravel-notification-channels.com/

driesvints commented 5 years ago

@lukasmu @nathanheffley maybe https://github.com/beyondcode/slack-notification-channel works better for you?

lukasmu commented 5 years ago

@driesvints This is funny. Seems like @mpociot more or less implemented my changes from this pull request in a brand new repository. Which basically is idea B I outlined above (just without the boilerplate).

However I was (and still am) unsure if this is a good approach (or whether A would be better)... Because if you at some point still update this repository in the future one cannot simply pull the changes into the new repository. But if you really don't want to maintain this repository any longer this shouldn't be a problem I guess.