Common interface for notification services.
Supported Gateways:
- Campfire
- GitHub (soon)
- Gitter
- Hipchat
- Intercom (soon)
- IRC (soon)
- Pagerduty
- Pebble Timeline (soon)
- Pushover
- SES (soon)
- Slack
- SNS (soon)
- Twilio
- Twitter (soon)
- Webhook
- XMPP (soon)
- Yo
Supported Bridges:
- Create a factory :
$factory = new NotifyMeHQ\NotifyMe\NotifyMeFactory();
- Make a notifier :
$notifier = $factory->make($config);
- Notify :
$response = $notifier->notify($to, $message);
- Check the response :
$response->isSent();
Here is an example of a notification with Slack:
<?php
// Create a factory for notifications
$notifierFactory = new NotifyMeHQ\NotifyMe\NotifyMeFactory();
// Create the new notification for slack
$slackNotifier = $notifierFactory->make([
// Specify that we will use slack
'driver' => 'slack',
// Add api token to get access to slack API
'token' => '',
// Who send this message, here is a bot called 'Super Bot'
'from' => 'Super Bot',
]);
/* @var \NotifyMeHQ\Contracts\ResponseInterface $response */
$response = $slackNotifier->notify('#sandbox', 'test message');
echo $response->isSent() ? 'Message sent' : 'Message going nowhere';
- Add docs
- Add tests
NotifyMe is licensed under The MIT License (MIT).