ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilMailCronOrphanedMailsNotifier Class Reference

ilMailCronOrphanedMailNotifier More...

+ Collaboration diagram for ilMailCronOrphanedMailsNotifier:

Public Member Functions

 __construct (ilMailCronOrphanedMailsNotificationCollector $collector, $threshold, $mail_notify_orphaned)
 ilMailCronOrphanedMailsNotifier constructor. More...
 
 processNotification ()
 

Protected Attributes

 $collector
 
 $db
 
 $threshold = 0
 
 $mail_notify_orphaned = 0
 

Private Member Functions

 markAsNotified (ilMailCronOrphanedMailsNotificationCollectionObj $collection_obj)
 
 sendMail (ilMailCronOrphanedMailsNotificationCollectionObj $collection_obj)
 

Detailed Description

ilMailCronOrphanedMailNotifier

Author
Nadia Matuschek nmatu.nosp@m.sche.nosp@m.k@dat.nosp@m.abay.nosp@m..de

Definition at line 8 of file class.ilMailCronOrphanedMailsNotifier.php.

Constructor & Destructor Documentation

◆ __construct()

ilMailCronOrphanedMailsNotifier::__construct ( ilMailCronOrphanedMailsNotificationCollector  $collector,
  $threshold,
  $mail_notify_orphaned 
)

ilMailCronOrphanedMailsNotifier constructor.

Parameters
ilMailCronOrphanedMailsNotificationCollector$collector
int$threshold
int$mail_notify_orphaned

Definition at line 36 of file class.ilMailCronOrphanedMailsNotifier.php.

37 {
38 global $DIC;
39
40 $this->db = $DIC->database();
41
42 $this->collector = $collector;
43 $this->threshold = $threshold;
44 $this->mail_notify_orphaned = $mail_notify_orphaned;
45 }
global $DIC
Definition: saml.php:7

References $collector, $DIC, $mail_notify_orphaned, and $threshold.

Member Function Documentation

◆ markAsNotified()

ilMailCronOrphanedMailsNotifier::markAsNotified ( ilMailCronOrphanedMailsNotificationCollectionObj  $collection_obj)
private
Parameters
ilMailCronOrphanedMailsNotificationCollectionObj$collection_obj

Definition at line 50 of file class.ilMailCronOrphanedMailsNotifier.php.

51 {
52 if ($this->threshold > $this->mail_notify_orphaned) {
53 $notify_days_before = $this->threshold - $this->mail_notify_orphaned;
54 } else {
55 $notify_days_before = 1;
56 }
57
58 $ts_delete = strtotime("+ " . $notify_days_before . " days");
59 $ts_for_deletion = mktime(0, 0, 0, date('m', $ts_delete), date('d', $ts_delete), date('Y', $ts_delete));
60
61 foreach ($collection_obj->getFolderObjects() as $folder_obj) {
62 $folder_id = $folder_obj->getFolderId();
63
64 foreach ($folder_obj->getOrphanedMailObjects() as $mail_obj) {
65 $mail_id = $mail_obj->getMailId();
66
67 $this->db->insert(
68 'mail_cron_orphaned',
69 array(
70 'mail_id' => array('integer', $mail_id),
71 'folder_id' => array('integer', $folder_id),
72 'ts_do_delete' => array('integer', $ts_for_deletion))
73 );
74 }
75 }
76 }
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())

References $mail_notify_orphaned, date, and ilMailCronOrphanedMailsNotificationCollectionObj\getFolderObjects().

Referenced by processNotification().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ processNotification()

ilMailCronOrphanedMailsNotifier::processNotification ( )

Definition at line 94 of file class.ilMailCronOrphanedMailsNotifier.php.

95 {
96 foreach ($this->collector->getCollection() as $collection_obj) {
97 $this->sendMail($collection_obj);
98 $this->markAsNotified($collection_obj);
99 }
100 }
markAsNotified(ilMailCronOrphanedMailsNotificationCollectionObj $collection_obj)
sendMail(ilMailCronOrphanedMailsNotificationCollectionObj $collection_obj)

References markAsNotified(), and sendMail().

+ Here is the call graph for this function:

◆ sendMail()

ilMailCronOrphanedMailsNotifier::sendMail ( ilMailCronOrphanedMailsNotificationCollectionObj  $collection_obj)
private
Parameters
ilMailCronOrphanedMailsNotificationCollectionObj$collection_obj

Definition at line 81 of file class.ilMailCronOrphanedMailsNotifier.php.

82 {
83 include_once './Services/Mail/classes/class.ilMailCronOrphanedMailsNotification.php';
85
86 $mail->setRecipients(array($collection_obj->getUserId()));
87 $mail->setAdditionalInformation(array('mail_folders' => $collection_obj->getFolderObjects()));
88 $mail->send();
89 }

References ilMailCronOrphanedMailsNotificationCollectionObj\getFolderObjects(), and ilMailCronOrphanedMailsNotificationCollectionObj\getUserId().

Referenced by processNotification().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $collector

ilMailCronOrphanedMailsNotifier::$collector
protected

Definition at line 13 of file class.ilMailCronOrphanedMailsNotifier.php.

Referenced by __construct().

◆ $db

ilMailCronOrphanedMailsNotifier::$db
protected

Definition at line 18 of file class.ilMailCronOrphanedMailsNotifier.php.

◆ $mail_notify_orphaned

ilMailCronOrphanedMailsNotifier::$mail_notify_orphaned = 0
protected

Definition at line 28 of file class.ilMailCronOrphanedMailsNotifier.php.

Referenced by __construct(), and markAsNotified().

◆ $threshold

ilMailCronOrphanedMailsNotifier::$threshold = 0
protected

Definition at line 23 of file class.ilMailCronOrphanedMailsNotifier.php.

Referenced by __construct().


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