ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilMailCronOrphanedMailsNotification.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2015 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4include_once './Services/Mail/classes/class.ilMimeMailNotification.php';
5include_once './Services/Mail/classes/class.ilMimeMail.php';
6
12{
16 public function __construct()
17 {
18 parent::__construct();
19 }
20
24 protected function initLanguageByIso2Code($a_code = '')
25 {
26 parent::initLanguageByIso2Code($a_code);
27 $this->getLanguage()->loadLanguageModule('user');
28 }
29
33 public function send()
34 {
35 foreach($this->getRecipients() as $rcp)
36 {
37 try
38 {
39 $this->handleCurrentRecipient($rcp);
40 }
41 catch(ilMailException $e)
42 {
43 continue;
44 }
45 $this->initMimeMail();
47 $this->setSubject($this->getLanguage()->txt('orphaned_mail_subject'));
48
50 $this->appendBody("\n\n");
51 $this->appendBody($this->getLanguage()->txt('orphaned_mail_body'));
52 $this->appendBody("\n\n");
53
54 $body = $this->getOrphandMailsBody();
55 $this->appendBody($body);
57 $this->sendMimeMail($this->getCurrentRecipient());
58 }
59 }
60
61 public function getOrphandMailsBody()
62 {
63 $additional_information = $this->getAdditionalInformation();
64 $mail_folders = $additional_information['mail_folders'];
65
66 foreach($mail_folders as $folder_object)
67 {
68 $folder_title = $this->getLanguage()->txt('mail_'.$folder_object->getFolderTitle());
69 $this->appendBody($folder_title.':');
70 $this->appendBody("\n");
71 foreach($folder_object->getOrphanedMailObjects() as $mail_object)
72 {
73 $this->appendBody($mail_object->getMailSubject());
74 $this->appendBody("\n");
75 }
76 }
77 }
78}
ILIAS Exception for Service Mail.
appendBody($a_body)
Append body text.
getRecipients()
get array of recipients
static getSalutation($a_usr_id, $a_language=null)
Get salutation.
static _getInstallationSignature()
Static getter for the installation signature.
Base class for mime mail notifications.