Symbiote\Notifications\Service\NotificationService
NotificationService
- Author: marcus@symbiote.com.au, shea@livesource.co.nz
- License: http://silverstripe.org/bsd-license/
Synopsis
class NotificationService
{
- // members
- private static array $default_senders = ;
- private static array $default_channels = ;
- private static Boolean $use_queues = true;
- protected $senders;
- protected $channels;
- // methods
- public void __construct()
- public NotificationService addChannel()
- public void getChannels()
- public NotificationService setChannels()
- public NotificationService addSender()
- public NotificationService setSenders()
- public mixed|null getSender()
- public void notify()
- public void sendNotification()
- public void sendToUser()
Hierarchy
Uses
- SilverStripe\Core\Config\Configurable
Members
private
- $default_channels
—
array
The list of channels to send to by default - $default_senders
—
array
The default notification send mechanisms to init with - $use_queues
—
Symbiote\Notifications\Service\Boolean
Should we use the queued jobs approach to sending notifications?
protected
- $channels
—
array
The list of channels to send to - $senders
—
array
The objects to use for actually sending a notification, indexed by their channel ID
Methods
public
- __construct()
- addChannel() — Add a channel that this notification service should use when sending notifications
- addSender() — Add a notification sender
- getChannels()
- getSender() — Get a sender for a particular channel
- notify() — Trigger a notification event
- sendNotification() — Send out a notification
- sendToUser() — Sends a notification directly to a user
- setChannels() — Set the list of channels this notification service should use when sending notifications
- setSenders() — Add a notification sender to a channel