Elgg  Version 5.1
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 (DelayedEmailQueueTable $queue_table, EmailService $email, ViewsService $views, Translator $translator, 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
 
 $queue_table
 
 $email
 
 $views
 
 $translator
 
 $invoker
 

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 ( DelayedEmailQueueTable  $queue_table,
EmailService  $email,
ViewsService  $views,
Translator  $translator,
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 62 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 77 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 99 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 161 of file DelayedEmailService.php.

Member Data Documentation

Elgg\Email\DelayedEmailService::$email
protected

Definition at line 36 of file DelayedEmailService.php.

Elgg\Email\DelayedEmailService::$invoker
protected

Definition at line 51 of file DelayedEmailService.php.

Elgg\Email\DelayedEmailService::$queue_table
protected

Definition at line 31 of file DelayedEmailService.php.

Elgg\Email\DelayedEmailService::$translator
protected

Definition at line 46 of file DelayedEmailService.php.

Elgg\Email\DelayedEmailService::$views
protected

Definition at line 41 of file DelayedEmailService.php.

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: