dealnews / slack
Slack PHP Library
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/dealnews/slack
Requires
- php: ^8.2
- guzzlehttp/guzzle: ^7.10
Requires (Dev)
README
A library for sending simple messages to Slack from PHP. We have used this internally for years. The other options out there seem to be out of date and no longer supported.
Send a Message
use DealNews\Slack\Message; // Send a simple text message $message = new Message($hook_url); $message->send("channel", "message"); // Send a formatted message $message->send( "channel", [ 'fallback' => 'Some fallback text for older clients', 'color' => '#dadada', 'fields' => [ [ 'title' => 'Test', 'value' => 'testing', 'short' => true, ], ], 'pretext' => 'pretext', 'author_name' => 'author', 'author_link' => 'http://www.example.com/', 'author_icon' => 'http://www.example.com/example.jpg', 'title' => 'title', 'title_link' => 'http://www.example.com/', 'text' => 'text', 'image_url' => 'http://www.example.com/example.jpg', 'thumb_url' => 'http://www.example.com/example.jpg', ] );