PHP class to help with Slack Incoming WebHooks
- PHP 5.3 or greater
You can install the package using the Composer package manager. You can install it by running this command in your project root:
composer require gaguerreiro/simple-slack:dev-master
require_once './vendor/autoload.php';
try {
$options = array(
'channel' => '#general',
'username' => 'Robot'
);
$ss = new SimpleSlack\Client("[YOUR TEAM ENDPOINT]", $options);
$ss->sendMessage('Message test');
} catch (SimpleSlackException $e) {
printf($e->getCode());
printf($e->getMessage());
}