Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

About

a post message to your slack workspace.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages