2017 © Pedro Peláez
 

silverstripe-module silverstripe-notifications

Simple service provider for sending notification to members over different media.

image

webtorque/silverstripe-notifications

Simple service provider for sending notification to members over different media.

  • Friday, July 6, 2018
  • by webtorque
  • Repository
  • 1 Watchers
  • 2 Stars
  • 293 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 4 Open issues
  • 10 Versions
  • 26 % Grown

The README.md

silverstripe-notifications Build Status

A SilverStripe module for handling notifications to user. This can be use to send notifications via various mediums to a Member., (*1)

Various notification are handled via a NotificationProvider. e.g.: NotificationEmailProvider will send email notifications while NotificationDataObjectProvider will store notifications in a DataObject for display one the website frontend., (*2)

Requirements

  • PHP 5.5 or greater (tested with up to PHP 7.1)
  • silverstripe/framework:^3.2
  • silverstripe/cms:^3.2

Optional

  • giggsey/libphonenumber-for-php:^8.0

Installing libphonenumber-for-php provides better mobile phone number validation., (*3)

Installation

composer require webtorque/silverstripe-notifications:^0.0

Configuration

Create a YAML config file to configure the NotificationService. You need to speciify a notification parser and a list of notification providers., (*4)

NotificationService:
  constructor:
    0: '%$NotificationParser'
    1:
      - "%$NotificationEmailProvider"
      - "%$NotificationDataObjectProvider"

The built-in NotificationParser will read notification format information from a NotificationType data objects. Notification types can be edited in the CMS. The expectation is that notification types will be predefined in your YML config. Creation or deletion of notification type are disallowed for all users., (*5)

NotificationType:
  default_records:
    - SystemName: 'RegistrationApproval'
      Name: 'Registration Approval'

    - SystemName: 'RegistrationApproved'
      Name: 'Registration Approved'

    - SystemName: 'NewPatientRequest'
      Name: 'New Patient Request'

    - SystemName: 'PatientRequestApproved'
      Name: 'Patient Request Approved'

    - SystemName: 'PatientRequestDeclined'
      Name: 'Patient Request Declined'

Usage

$service = Injector::inst()->get('NotificationService');
$deliveries = $service->send(
    'RegistrationApproval',                         # Notification type system name.
    ['extra' => 'Data to inject in the message'],   # Abritary data to inject in the NotificationParser.
    Member::currentUser(),                          # User who should receive the notification.
    '/notification/call-to-action-url'              # Optional Call-to-Action URL.
);

# List of NotificationFailureException for providers who failed to deliver the notification.
$deliveries->getFailures();   

# List of response from providers delivered their notification as expected.
$deliveries->getDeliveries();

The Versions

06/07 2018

dev-master

9999999-dev

Simple service provider for sending notification to members over different media.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Maxime Rainville

06/07 2018

v1.0.2

1.0.2.0

Simple service provider for sending notification to members over different media.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Maxime Rainville

06/07 2018

v1.0.1

1.0.1.0

Simple service provider for sending notification to members over different media.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Maxime Rainville

30/01 2018

v1.0.0

1.0.0.0

Simple service provider for sending notification to members over different media.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Maxime Rainville

30/01 2018

dev-dev

dev-dev

Simple service provider for sending notification to members over different media.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Maxime Rainville

26/10 2017

v0.2.0

0.2.0.0

Simple service provider for sending notification to members over different media.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Maxime Rainville

28/09 2017

v0.1.1

0.1.1.0

Simple service provider for sending notification to members over different media.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Maxime Rainville

15/08 2017

v0.1.0

0.1.0.0

Simple service provider for sending notification to members over different media.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Maxime Rainville

14/08 2017

v0.0.1

0.0.1.0

Simple service provider for sending notification to members over different media.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Maxime Rainville

09/08 2017

v0.0.0

0.0.0.0

Simple service provider for sending notification to members over different media.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Maxime Rainville