triniti/notify

Php library that provides implementations for triniti:notify schemas.

v1.1.1 2020-02-05 17:59 UTC

README

Build Status Code Climate Test Coverage

Php library that provides implementations for triniti:notify schemas. Using this library assumes that you've already created and compiled your own pbj classes using the Pbjc and are making use of the "triniti:notify:mixin:*" mixins from triniti/schemas.

Symfony Integration

Enabling these services in a Symfony app is done by importing classes and letting Symfony autoconfigure and autowire them.

config/packages/notify.yml:

services:
  _defaults:
    autowire: true
    autoconfigure: true
    public: true

  Triniti\Notify\:
    resource: '%kernel.project_dir%/vendor/triniti/notify/src/**/*'
    exclude: '%kernel.project_dir%/vendor/triniti/notify/src/Notifier/*'
    public: false
    #tags:
    #  - {name: monolog.logger, channel: notify}
    #bind:
    #  $logger: '@monolog.logger.notify'

  Triniti\Notify\NotifierLocator: '@Triniti\Notify\ContainerAwareNotifierLocator'

  Triniti\Notify\Notifier\:
    resource: '%kernel.project_dir%/vendor/triniti/notify/src/Notifier/*Notifier*'
    #tags:
    #  - {name: monolog.logger, channel: notify}
    #bind:
    #  $logger: '@monolog.logger.notify'

  # todo: implement alexa, browser, slack and sms notifiers
  acme_notify.alexa_notifier: '@Triniti\Notify\Notifier\AlexaNotifier'
  acme_notify.android_notifier: '@Triniti\Notify\Notifier\AndroidNotifier'
  acme_notify.apple_news_notifier: '@Triniti\Notify\Notifier\AppleNewsNotifier'
  acme_notify.browser_notifier: '@Triniti\Notify\Notifier\BrowserNotifier'
  acme_notify.email_notifier: '@Triniti\Notify\Notifier\SendGridEmailNotifier'
  acme_notify.ios_notifier: '@Triniti\Notify\Notifier\IosNotifier'
  acme_notify.slack_notifier: '@Triniti\Notify\Notifier\SlackNotifier'
  acme_notify.sms_notifier: '@Triniti\Notify\Notifier\SmsNotifier'