2017 © Pedro Peláez
 

library notifier

Library for send user notifications by different transports

image

mildberry/notifier

Library for send user notifications by different transports

  • Monday, October 3, 2016
  • by zyuskin_en
  • Repository
  • 1 Watchers
  • 1 Stars
  • 562 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Notifier

Library for send user notifications by different transports, (*1)

SensioLabsInsight Build Status codecov, (*2)

Install

``` bash $ composer require mildberry/notifier, (*3)


## Usage ``` php <?php use Mildberry\Notifier\Interfaces\SmsNotifyInterface; use Mildberry\Notifier\Notifier; use Mildberry\Notifier\Notify\NotifyCollection; use Mildberry\Notifier\Notify\SmsNotify; use Mildberry\Notifier\Transport\VarDumpTransport; include 'vendor/autoload.php'; $notifier = new Notifier(); $notifier->setNotifyTransport(SmsNotifyInterface::class, (new VarDumpTransport())); $notifier->send(new SmsNotify('79136703311', 'Hello world')); $collectionSms = new NotifyCollection(); $collectionSms ->push(new SmsNotify('79136703311', 'How a you?')) ->push(new SmsNotify('79136703311', 'Where are you?')); $notifier->sendCollection($collectionSms);

Custom notify

``` php <?php, (*4)

use Mildberry\Notifier\Interfaces\SmsNotifyInterface; use Mildberry\Notifier\Notifier; use Mildberry\Notifier\Notify\Notify; use Mildberry\Notifier\Transport\VarDumpTransport;, (*5)

include 'vendor/autoload.php';, (*6)

class ActivationSms extends Notify implements SmsNotifyInterface { public function __construct($phone, $code) { $this ->setRecipient($phone) ->setBody('Your activation code is '.$code) ; } }, (*7)

class RegistrationCompleteSms extends Notify implements SmsNotifyInterface { public function __construct($phone) { $this ->setRecipient($phone) ->setBody('Congratulations registration is completed') ; } }, (*8)

$notifier = new Notifier(); $notifier->setNotifyTransport(SmsNotifyInterface::class, (new VarDumpTransport()));, (*9)

// ... registration process, (*10)

$notifier->send(new ActivationSms('79136703311', rand(1, 9999)));, (*11)

// ... registration complete, (*12)

$notifier->send(new RegistrationCompleteSms('79136703311')); ```, (*13)

TODO

  • Documentation for Transports
  • Documentation for Storage
  • Saving externalID and save delivery state from transport
  • Notify query

License

This library is under the MIT license. See the complete license in here, (*14)

The Versions

03/10 2016

dev-master

9999999-dev https://github.com/mildberry/notifier

Library for send user notifications by different transports

  Sources   Download

MIT

The Requires

 

The Development Requires

by Egor Zyuskin

email php sms push

03/10 2016

v0.0.3

0.0.3.0 https://github.com/mildberry/notifier

Library for send user notifications by different transports

  Sources   Download

MIT

The Requires

 

The Development Requires

by Egor Zyuskin

email php sms push

03/10 2016

v0.0.2

0.0.2.0 https://github.com/mildberry/notifier

Library for send user notifications by different transports

  Sources   Download

MIT

The Requires

 

The Development Requires

by Egor Zyuskin

email php sms push

28/09 2016

v0.0.1

0.0.1.0 https://github.com/mildberry/notifier

Library for send user notifications by different transports

  Sources   Download

MIT

The Requires

 

The Development Requires

by Egor Zyuskin

email php sms push