Closed TomaszOnePilot closed 3 weeks ago
Hello,
this release invalidates the following part of documentation
null - which defers routing to the channel configured in the notification itself. You may use the to method when building your SlackMessage to configure the channel within the notification.
Indeed this goes against the documentation and breaks the functionality. Slack notifications are no longer sent if you’re defining the channel in the notification itself.
I don't mind the change, however this was a breaking change to the expected and documented behaviour.
If routeNotificationForSlack
is not explicitly set it will no longer fallback to the channel defined in services.slack.notifications.channel
.
As a workaround I add the following:
/**
* Route notifications for the Slack channel.
*/
public function routeNotificationForSlack(Notification $notification): mixed
{
return config('services.slack.notifications.channel');
}
Unfortunately, it is a breaking change as already said above. Moved to 3.3.0 right now. But hope this will be fixed
Thanks all. I reverted this one.
Hello Laravel team 😃 We moved
slack-notification-channel
fromv2
tov3
, but not yet applied what needed to useSlackWebApiChannel
, so for now we would like to use stillSlackWebhookChannel
for a while.We have an issue in production :
I can see that it was partially fixed here : https://github.com/laravel/slack-notification-channel/pull/87 But it fixed only for
false
values.And in some cases we would like for example to specify many channels in laravel Notification's
via()
method, like for example 👇And let's say that sometimes we want only to notify via email like that 👇
The slack notification will fail here because we don't specify the route and we try notifying anyway. For example when you have in your logic a notifiable that in
routeNotificationForSlack()
(or inrouteNotificationFor()
because note thatAnonymousNotifiable
doesn't have routeNotificationForSlack method) can returnnull
, like inAnonymousNotifiable
for example 👇And
null
is not striclty equal tofalse
inSlackNotificationRouterChannel
'ssend
method, so the script goes on and enterSlackWebApiChannel
, while we did not implement it yet (staying with v2 webhook way for now) and in addition we would like here only to notify by email, not slack.