45 $this->db = $DIC->database();
52 $this->mark_as_notified_stmt = $this->db->prepareManip(
53 'INSERT INTO mail_cron_orphaned (mail_id, folder_id, ts_do_delete) VALUES (?, ?, ?)',
63 if ($this->threshold > $this->mail_notify_orphaned) {
66 $notify_days_before = 1;
69 $ts_delete = strtotime(
"+ " . $notify_days_before .
" days");
70 $ts_for_deletion = mktime(0, 0, 0, date(
'm', $ts_delete), date(
'd', $ts_delete), date(
'Y', $ts_delete));
74 $folder_id = $folder_obj->getFolderId();
76 foreach ($folder_obj->getOrphanedMailObjects() as $mail_obj) {
77 $mail_id = $mail_obj->getMailId();
79 if (
$i > 0 &&
$i % self::NOTIFICATION_MARKER_PING_THRESHOLD === 0) {
84 $this->mark_as_notified_stmt,
85 [$mail_id, $folder_id, $ts_for_deletion]
97 include_once
'./Services/Mail/classes/class.ilMailCronOrphanedMailsNotification.php';
100 $mail->setRecipients(array($collection_obj->
getUserId()));
101 $mail->setAdditionalInformation(array(
'mail_folders' => $collection_obj->
getFolderObjects()));
111 foreach ($this->collector->getCollection() as $collection_obj) {
112 if (
$i > 0 &&
$i % self::MAIL_DELIVERY_PING_THRESHOLD === 0) {
Class ilMailCronOrphanedMailsNotification.
ilMailCronOrphanedMailsNotificationCollectionObj
const NOTIFICATION_MARKER_PING_THRESHOLD
markAsNotified(ilMailCronOrphanedMailsNotificationCollectionObj $collection_obj)
ilMailCronOrphanedMailsNotificationCollector
ilMailCronOrphanedMailNotifier
sendMail(ilMailCronOrphanedMailsNotificationCollectionObj $collection_obj)
__construct(ilMailCronOrphanedMails $job, ilMailCronOrphanedMailsNotificationCollector $collector, $threshold, $mail_notify_orphaned)
ilMailCronOrphanedMailsNotifier constructor.
const MAIL_DELIVERY_PING_THRESHOLD