dealnews/slack

There is no license information available for the latest version (2.0.0) of this package.

Slack PHP Library

Installs: 0

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/dealnews/slack

2.0.0 2025-11-09 00:51 UTC

This package is auto-updated.

Last update: 2025-11-09 00:53:09 UTC


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',
    ]
);