Elgg  Version master
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Elgg\Email\DelayedEmailService Class Reference

Handle storing and processing delayed emails. More...

Public Member Functions

 __construct (protected DelayedEmailQueueTable $queue_table, protected EmailService $email, protected ViewsService $views, protected Translator $translator, protected Invoker $invoker)
 Create a new service. More...
 
 enqueueNotification (Notification $notification)
 Queue a notification for delayed email delivery. More...
 
 processQueuedNotifications (string $delivery_interval, int $timestamp)
 Send out notifications for the given delivery_interval. More...
 

Protected Member Functions

 processRecipientNotifications (int $recipient_guid, array $notifications, string $delivery_interval)
 Send out the combined email notification for a given recipient. More...
 

Protected Attributes

const NOTIFICATIONS_BATCH_SIZE = 500
 

Detailed Description

Handle storing and processing delayed emails.

Since
4.0

Definition at line 22 of file DelayedEmailService.php.

Constructor & Destructor Documentation

Elgg\Email\DelayedEmailService::__construct ( protected DelayedEmailQueueTable  $queue_table,
protected EmailService  $email,
protected ViewsService  $views,
protected Translator  $translator,
protected Invoker  $invoker 
)

Create a new service.

Parameters
DelayedEmailQueueTable$queue_tablethe queue database table
EmailService$emailemail service
ViewsService$viewsviews service
Translator$translatortranslator service
Invoker$invokerinvoker serivce

Definition at line 37 of file DelayedEmailService.php.

Member Function Documentation

Elgg\Email\DelayedEmailService::enqueueNotification ( Notification  $notification)

Queue a notification for delayed email delivery.

Parameters
Notification$notificationthe notification
Returns
bool

Definition at line 53 of file DelayedEmailService.php.

Elgg\Email\DelayedEmailService::processQueuedNotifications ( string  $delivery_interval,
int  $timestamp 
)

Send out notifications for the given delivery_interval.

Parameters
string$delivery_intervalthe delivery interval to process
int$timestampthe timestamp until which queued notifications should be picked up
Returns
int number of notifications handled

Definition at line 75 of file DelayedEmailService.php.

Elgg\Email\DelayedEmailService::processRecipientNotifications ( int  $recipient_guid,
array  $notifications,
string  $delivery_interval 
)
protected

Send out the combined email notification for a given recipient.

Parameters
int$recipient_guidthe GUID of the recipient
array$notificationsall delayed notifications for the recipient in the given delivery_interval
string$delivery_intervalthe delivery interval
Returns
bool

Definition at line 137 of file DelayedEmailService.php.

Member Data Documentation

const Elgg\Email\DelayedEmailService::NOTIFICATIONS_BATCH_SIZE = 500
protected

Definition at line 26 of file DelayedEmailService.php.


The documentation for this class was generated from the following file: