This commit is contained in:
Adrian Hopek
2022-04-27 11:49:01 +02:00
parent e7d9cfe3d0
commit 29c06d625b
9 changed files with 145 additions and 42 deletions

View File

@@ -17,11 +17,12 @@ class SlackApiChannel
$url = "{$baseUrl}/chat.postMessage";
$channel = $notifiable->routeNotificationFor("slack", $notification);
$message = $notification->toSlack($notifiable);
return Http::withToken($this->getClientToken())
->post($url, [
->post($url, array_merge($message->getPayload(), [
"channel" => $channel,
"text" => $notification->toSlack($notifiable),
]);
]));
}
protected function getClientToken(): string