Notifier integration for symfony projects.
Installing this bundle can be done through these simple steps:
- Add the bundle to your project as a composer dependency:
// composer.json
{
// ...
require: {
// ...
"notifier/notifier-bundle": "~1.0"
}
}
- Update your composer installation:
composer update
- Add the bundle to your application kernel:
// app/AppKernel.php
public function registerBundles()
{
// ...
$bundle = array(
// ...
new Notifier\NotifierBundle\NotifierNotifierBundle(),
);
// ...
return $bundles;
}
Implement the data provider
Implement \Notifier\NotifierBundle\Notifier\RecipientChannelResolverInterface
and register it as a service.
Than register that service identifier as the recipient_channel_resolver
.
Configure the types
config.yml
notifier:
recipient_channel_resolver: "acme.recipient_channel_resolver"
types:
alert:
channels: [ "acme.mail_channel" ]
Make sure the channels all resolve to an existing service defined in the project.
Send a message
use Notifier\Message\Message;
use Notifier\Recipient\Recipient;
use Notifier\NotifierBundle\Type\Type;
// ...
$message = new Message(new Type('alert'));
$this->get('notifier')->sendMessage($message, array(new Recipient('identifier')));
All code contributions - including those of people having commit access - must go through a pull request and approved by a core developer before being merged. This is to ensure proper review of all the code.
Fork the project, create a feature branch, and send us a pull request.
To ensure a consistent code base, you should make sure the code follows the Coding Standards which we borrowed from Symfony. Make sure to check out php-cs-fixer as this will help you a lot.
If you would like to help, take a look at the list of issues.
PHP 5.3.2 or above
Dries De Peuter - [email protected] - http://nousefreak.be
See also the list of contributors who participated in this project.
NotifierBundle is licensed under the MIT license.