ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilMailCronOrphanedMailsNotifier Class Reference

ilMailCronOrphanedMailNotifier More...

+ Collaboration diagram for ilMailCronOrphanedMailsNotifier:

Public Member Functions

 __construct (ilMailCronOrphanedMailsNotificationCollector $collector)
 
 processNotification ()
 

Protected Attributes

 $collector = NULL
 

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)

Member Function Documentation

◆ markAsNotified()

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

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

27 {
28 global $ilDB;
29
30 if($this->threshold > $this->mail_notify_orphaned )
31 {
32 $notify_days_before = $this->threshold - $this->mail_notify_orphaned;
33 }
34 else
35 {
36 $notify_days_before = 1;
37 }
38
39 $ts_delete = strtotime("+ ".$notify_days_before." days");
40 $this->ts_for_deletion = mktime(0, 0, 0, date('m', $ts_delete), date('d', $ts_delete), date('Y', $ts_delete));
41
42 foreach($collection_obj->getFolderObjects() as $folder_obj)
43 {
44 $folder_id = $folder_obj->getFolderId();
45
46 foreach($folder_obj->getOrphanedMailObjects() as $mail_obj)
47 {
48 $mail_id = $mail_obj->getMailId();
49
50 $ilDB->insert('mail_cron_orphaned', array(
51 'mail_id' => array('integer', $mail_id),
52 'folder_id' => array('integer', $folder_id),
53 'ts_do_delete' => array('integer', $this->ts_for_deletion))
54 );
55 }
56 }
57 }
global $ilDB

References $ilDB.

Referenced by processNotification().

+ Here is the caller graph for this function:

◆ processNotification()

ilMailCronOrphanedMailsNotifier::processNotification ( )

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

76 {
77 foreach($this->collector->getCollection() as $collection_obj)
78 {
79 $this->sendMail($collection_obj);
80 $this->markAsNotified($collection_obj);
81 }
82 }
sendMail(ilMailCronOrphanedMailsNotificationCollectionObj $collection_obj)
markAsNotified(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 62 of file class.ilMailCronOrphanedMailsNotifier.php.

63 {
64 include_once './Services/Mail/classes/class.ilMailCronOrphanedMailsNotification.php';
66
67 $mail->setRecipients(array($collection_obj->getUserId()));
68 $mail->setAdditionalInformation(array('mail_folders' => $collection_obj->getFolderObjects()));
69 $mail->send();
70 }

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 = NULL
protected

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

Referenced by __construct().


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