ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilMailCronOrphanedMailsNotification Class Reference

Class ilMailCronOrphanedMailsNotification. More...

+ Inheritance diagram for ilMailCronOrphanedMailsNotification:
+ Collaboration diagram for ilMailCronOrphanedMailsNotification:

Public Member Functions

 __construct ($a_is_personal_workspace=false)
 {} More...
 
 send ()
 
 getOrphandMailsBody ()
 
- Public Member Functions inherited from ilMimeMailNotification
 sendMimeMail ($a_rcp)
 
 setCurrentRecipient ($current_recipient)
 
 getCurrentRecipient ()
 
 setMimeMail ($mime_mail)
 
 getMimeMail ()
 
- Public Member Functions inherited from ilMailNotification
 __construct ($a_is_personal_workspace=false)
 
 setType ($a_type)
 Set notification type. More...
 
 getType ()
 Get notification type. More...
 
 setSender ($a_usr_id)
 Set sender of mail. More...
 
 getSender ()
 get sender of mail More...
 
 setRecipients (array $a_rcp)
 
 getRecipients ()
 get array of recipients More...
 
 setAttachments ($a_att)
 Set attachments. More...
 
 getAttachments ()
 Get attachments. More...
 
 setLangModules (array $a_modules)
 Set lang modules. More...
 
 getUserLanguage ($a_usr_id)
 Get user language. More...
 
 setRefId ($a_id)
 
 getRefId ()
 
 getObjId ()
 
 setObjId ($a_obj_id)
 
 getObjType ()
 Get object type. More...
 
 setAdditionalInformation (array $a_info)
 Additional information for creating notification mails. More...
 
 getAdditionalInformation ()
 
 sendMail (array $a_rcp, $a_type, $a_parse_recipients=true)
 
 getBlockBorder ()
 Get (ascii) block border. More...
 

Protected Member Functions

 initLanguageByIso2Code ($a_code='')
 
- Protected Member Functions inherited from ilMimeMailNotification
 initLanguageByIso2Code ($a_code='')
 
 initLanguage ($a_usr_id)
 
- Protected Member Functions inherited from ilMailNotification
 setSubject ($a_subject)
 
 getSubject ()
 
 setBody ($a_body)
 
 appendBody ($a_body)
 Append body text. More...
 
 getBody ()
 
 initLanguage ($a_usr_id)
 Init language. More...
 
 initLanguageByIso2Code ($a_code='')
 Init language by ISO2 code. More...
 
 setLanguage ($a_language)
 
 getLanguage ()
 
 getLanguageText ($a_keyword)
 
 getObjectTitle ($a_shorten=false)
 
 initMail ()
 
 getMail ()
 
 createPermanentLink ($a_params=array(), $a_append='')
 
 userToString ($a_usr_id)
 
 isRefIdAccessible ($a_user_id, $a_ref_id, $a_permission="read")
 Check if ref id is accessible for user. More...
 

Additional Inherited Members

- Data Fields inherited from ilMailNotification
const SUBJECT_TITLE_LENGTH = 60
 
- Protected Attributes inherited from ilMimeMailNotification
 $mime_mail
 
 $current_recipient
 
- Protected Attributes inherited from ilMailNotification
 $type = null
 
 $sender = null
 
 $mail = null
 
 $subject = ''
 
 $body = ''
 
 $attachments = array()
 
 $language = null
 
 $lang_modules = array()
 
 $recipients = array()
 
 $ref_id = null
 
 $obj_id = null
 
 $obj_type = null
 
 $additional_info = array()
 
 $is_in_wsp
 
 $wsp_tree
 
 $wsp_access_handler
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilMailCronOrphanedMailsNotification::__construct (   $a_is_personal_workspace = false)

{}

Definition at line 16 of file class.ilMailCronOrphanedMailsNotification.php.

17  {
18  parent::__construct($a_is_personal_workspace);
19  }

Member Function Documentation

◆ getOrphandMailsBody()

ilMailCronOrphanedMailsNotification::getOrphandMailsBody ( )

Definition at line 61 of file class.ilMailCronOrphanedMailsNotification.php.

References ilMailNotification\appendBody(), ilMailNotification\getAdditionalInformation(), and ilMailNotification\getLanguage().

Referenced by send().

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  }
appendBody($a_body)
Append body text.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initLanguageByIso2Code()

ilMailCronOrphanedMailsNotification::initLanguageByIso2Code (   $a_code = '')
protected
Parameters
string$a_code

Definition at line 24 of file class.ilMailCronOrphanedMailsNotification.php.

References ilMailNotification\getLanguage().

Referenced by send().

25  {
26  parent::initLanguageByIso2Code($a_code);
27  $this->getLanguage()->loadLanguageModule('user');
28  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ send()

ilMailCronOrphanedMailsNotification::send ( )

Definition at line 33 of file class.ilMailCronOrphanedMailsNotification.php.

References ilMailNotification\$body, ilMailNotification\appendBody(), ilMimeMailNotification\getCurrentRecipient(), ilMailNotification\getLanguage(), getOrphandMailsBody(), ilMailNotification\getRecipients(), initLanguageByIso2Code(), ilMimeMailNotification\sendMimeMail(), and ilMailNotification\setSubject().

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();
46  $this->initLanguageByIso2Code();
47  $this->setSubject($this->getLanguage()->txt('orphaned_mail_subject'));
48 
49  $this->appendBody(ilMail::getSalutation($rcp));
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);
56  $this->appendBody(ilMail::_getInstallationSignature());
57  $this->sendMimeMail($this->getCurrentRecipient());
58  }
59  }
Class ilMailException.
getRecipients()
get array of recipients
appendBody($a_body)
Append body text.
+ Here is the call graph for this function:

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