13 use Elgg\Traits\Loggable;
56 $delivery_interval =
$recipient->delayed_email_interval ?:
'daily';
61 $this->getLogger()->error($e);
86 }
catch (\Throwable $t) {
87 $this->getLogger()->error($t);
99 while (!empty(
$rows)) {
102 foreach (
$rows as $row) {
103 $max_id = max($max_id, $row->id);
146 'delivery_interval' => $delivery_interval,
149 $body = $this->views->renderView(
'email/delayed_email/plaintext', $view_vars);
154 $html_body = $this->views->renderView(
'email/delayed_email/html', $view_vars);
158 'subject' => $this->translator->translate(
"notifications:delayed_email:subject:{$delivery_interval}", [], (
string)
$recipient->language),
161 'html_body' => $html_body,
Interfaces with the database to perform operations on the delayed_email_queue table.
Handle storing and processing delayed emails.
enqueueNotification(Notification $notification)
Queue a notification for delayed email delivery.
processQueuedNotifications(string $delivery_interval, int $timestamp)
Send out notifications for the given delivery_interval.
__construct(protected DelayedEmailQueueTable $queue_table, protected EmailService $email, protected ViewsService $views, protected Translator $translator, protected Invoker $invoker)
Create a new service.
processRecipientNotifications(int $recipient_guid, array $notifications, string $delivery_interval)
Send out the combined email notification for a given recipient.
const NOTIFICATIONS_BATCH_SIZE
A generic parent class for database exceptions.
const ELGG_IGNORE_ACCESS
elgg_call() flags
get_entity(int $guid)
Loads and returns an entity object from a guid.