Send notifications using any delivery method.
Using this library, you can send messages to users following their preffered channels. This will help you focus on your application code and leave the message sending to your Notifier implementation.
Caution: Only use < 2.0 in production!
Say you want your users to choose how they receive notifications from your application. For example on a new private message you have them choose SMS, email or both. Notifier will help you handle these choices. From within your application you don't need to worry about what delivery type the user chose. You just send the message indicating what type the message is and Notifier will resolve the correct channels and send it.
This is an example of the implementation of the MailChannel.
use Notifier\Mail\ParameterBag\MailMessageParameterBag; use Notifier\Mail\ParameterBag\MailRecipientParameterBag; use Notifier\Recipient\Recipient; use Notifier\Message\Message; use Notifier\Notifier; $message = new Message(new InformationType()); $message->addParameterBag(new MailMessageParameterBag('Mail subject', 'Body...')); $recipient = new Recipient(); $recipient->addParameterBag(new MailRecipientParameterBag('email@example.com')); // The ChannelResolver will decide to which channels a message of a specific type must be sent. $notifier = new Notifier(new RecoverPasswordChannelResolver()); $notifier->sendMessage($message, array($recipient));
The project is in active development of 2.0.x. Please refer to 1.0.x if you want to use this in production.
Notifier is stripped of most channels. You can find a list of all available channels.
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.
If you would like to help take a look at the list of issues.
PHP 5.3.2 or above
See also the list of contributors who participated in this project.
Notifier is licensed under the MIT license.