NotificationSender
NotificationSender
Notification Sender
Holds a collection of notifications. Sends notifications by inserting in the database and optionally sends by email based on the recipient’s notification settings.
TODO: Add background processing for notification emails.
- Full name: \Gibbon\Comms\NotificationSender
Methods
- __construct — Injects a gateway and session dependency, used for database inserts and email formatting.
- addNotification — Adds a notification to the collection as an array.
- getNotificationCount — Gets the current notification count.
- sendNotifications — Delivers all notifications by inserting/updating in database, and optionally by sends by email.
- sendNotificationsAsBcc — Delivers all notifications. Helper method to clarify the intent of the Bcc sending option.
__construct
Injects a gateway and session dependency, used for database inserts and email formatting.
NotificationSender::__construct( \Gibbon\Domain\System\NotificationGateway $gateway, \Gibbon\session $session )
addNotification
Adds a notification to the collection as an array.
NotificationSender::addNotification( integer|string $gibbonPersonID, string $text, string $moduleName, string $actionLink ): self
Returns Self: This method can be chained.
getNotificationCount
Gets the current notification count.
NotificationSender::getNotificationCount( ): integer
Return Value:
integer
sendNotifications
Delivers all notifications by inserting/updating in database, and optionally by sends by email.
NotificationSender::sendNotifications( $bccMode = false ): array
Return Value:
array
Send report with success/fail counts.
sendNotificationsAsBcc
Delivers all notifications. Helper method to clarify the intent of the Bcc sending option.
NotificationSender::sendNotificationsAsBcc( ): array
Return Value:
array
Send report with success/fail counts.