Download the PHP package i-lateral/silverstripe-notifier without Composer

On this page you can find all versions of the php package i-lateral/silverstripe-notifier. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package silverstripe-notifier

SilverStripe Notifications System

Scrutinizer Code Quality Build Status

Module to allow creation of custom notifications for object changes that can be managed via the admin.

Install

Install this module via composer:

composer require i-lateral/silverstripe-notifier

Once installed run dev/build to add additional database tables

Configuration and Setup

Once installed, you will have to register the DataObjects you want to be monitored for notification with Notifier. This can be done via fairly simple config:

---
Name: notificationsconfig
---
# allow configuring of notifications to users and a custom page type
ilateral\SilverStripe\Notifier\Notifier:
  registered_objects:
    - SilverStripe\Security\Member
    - App\Model\MyCustomPage

Once this configuration is added (and you flush the cache), navigate to SiteConfig ("Settings" in the admin).

Now there will be a "notifications" tab allowing you to add new notifications

Adding notifications

When you add a new notification you will be able to choose the object to monitor (from the list of registered objects above). You can then also choose:

StateCreated: Should a notification be sent on object creation

StateUpdated: Should a notification be sent if an object is ever updated

StateDeleted: Should a notification be sent if an object is deleted

Adding Rules (optional)

You can also add more granular rules for each notification. These allow you to specify:

FieldName: The name of the data field on the object that will be checked

Value: If set, when an object has a field that is set to this value, send a notification

WasChanged: If you leave Value blank, then you can check WasChanged and then any change to this field will send a notification

Disallow Notification Rules (optional)

You can disallow notification rules on specific notifications via the disallow_rules config variable. This needs to be a list of rule classnames that this notification type will not allow. This can be set in YML as follows:

---
Name: notificationsconfig
---
# Disallow basic notification rule
ilateral\SilverStripe\Notifier\Model\Notification:
  disallow_rules:
    - ilateral\SilverStripe\Notifier\Model\Notification\NotificationRule

Adding Notification Types

Once you have specified an object to monitor and what will trigger notifications you then need to specify how these notifications will be sent.

By default this module includes an EmailNotification, which will send an email to the desired recipient using the provided subject and content.

You can add multiple versions of the each NotificationType to the same Notification (for example, if you want to email multiple people in the event of a change).

Disallow Notification Types (optional)

You can disallow notification types on specific notifications via the disallow_types config variable. This needs to be a list of rule classnames that this notification type will not allow. This can be set in YML as follows:

---
Name: notificationsconfig
---
# Disallow email notification type
ilateral\SilverStripe\Notifier\Model\Notification:
  disallow_types:
    - ilateral\SilverStripe\Notifier\Types\EmailNotification

Content Rendering

Notification content (and email subjects) support using SilverStripe variables When a notification is sent, the context with regards to variables will be the current object that is being monitored.

EXAMPLE If sending an email when a new Member is created, you can add {$FirstName}, {$Surname}, {$Email} etc to your Content area, and these will be rendered using the newly created Member.

New Notification Types

The system is designed to fairly easily add new notification types (for example SMS notifications) You simply have to extend NotificationType and add your own send method to handle sending the notification.

Dynamic senders and recipients

Instead of using a predefined sender and recipients, you can instead specify fields on the monitored object to use.

Before you can do this though, you have to inform Notifier that you want to use custom fields. For example, if you have the following object:

You can add custom config:

Now, when you log into your admin area and visit: Settings > Notifications and setup a new notification you will see alternate dropdowns that let you select the field you would like yo use.


All versions of silverstripe-notifier with dependencies

PHP Build Version
Package Version
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package i-lateral/silverstripe-notifier contains the following files

Loading the files please wait ....