Skip to content
a post message to your slack workspace.
PHP
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
tests
.coveralls.yml
.gitignore
.travis.yml
README.md
composer.json
composer.lock
phpcs.xml
phpmd.xml
phpunit.xml.dist

README.md

Slack Notifier

Slackへのメッセージ投稿を簡単にするやつ

installation

With Composer

$ composer require chanshige/slack-notifier 'v0.1'

usage

<?php
require __DIR__ . '/vendor/autoload.php';

use Chanshige\SlackNotifier;
use Chanshige\Messages\SlackMessage;
use Chanshige\Messages\SlackAttachment;

// default message
$message = (new SlackMessage())->channel('#general')
           ->username('chanshigebot');

// with attachments
$attachment = (new SlackAttachment())->fallback('fallback message')
           ->color('#black')
           ->authorName('author name')
           ->pretext('pretext')
           ->title('text')
           ->footer('footer message')
           ->footerIcon('http://localhost.icon.url')
           ->imageUrl('localhost.image.url')
           ->thumbUrl('localhost.thumb.url')
           ->titleLink('localhost.title.url');

$message->attachments([$attachment]);

$notifier = new SlackNotifier('https://slack.incoming.webhook.uri');
// to slack!
$notifier->send($message);

test

$ composer test

coverage

coverage

License

MIT

Author

chanshige

You can’t perform that action at this time.