4 include_once
'./Services/Mail/classes/class.ilMailNotification.php';
6 include_once
'Services/Mail/classes/class.ilMimeMail.php';
7 include_once
'Services/Mail/classes/class.ilMail.php';
29 $is_message_enabled = $ilSetting->get(
"mail_notification_message");
31 $res = $ilDB->queryF(
'SELECT mail.* FROM mail_options
32 INNER JOIN mail ON mail.user_id = mail_options.user_id
33 INNER JOIN mail_obj_data ON mail_obj_data.obj_id = mail.folder_id
34 WHERE cronjob_notification = %s
37 array(
'integer',
'timestamp',
'text'),
38 array(1, date(
'Y-m-d H:i:s', time() - 60 * 60 * 24),
'unread')
44 while(
$row = $ilDB->fetchAssoc(
$res))
46 if($user_id == 0 ||
$row[
'user_id'] != $user_id)
48 $user_id =
$row[
'user_id'];
50 $users[$user_id][] =
$row;
53 foreach($users as $user_id => $mail_data)
65 if(count($mail_data) == 1)
76 foreach($mail_data as
$mail)
78 $this->
appendBody(
"----------------------------------------------------------------------------------------------");
81 $this->
appendBody($user_lang->txt(
'date') .
": ".$mail[
'send_time']);
83 if($mail[
'sender_id'] == ANONYMOUS_USER_ID)
85 $sender = ilMail::_getIliasMailerName();
93 $this->
appendBody($user_lang->txt(
'subject').
": ". $mail[
'm_subject']);
96 if($is_message_enabled ==
true)
98 $this->
appendBody($user_lang->txt(
'message').
": ". $mail[
'm_message']);
103 $this->
appendBody(
"----------------------------------------------------------------------------------------------");
105 $this->
appendBody($user_lang->txt(
'follow_link_to_read_mails').
" ");
108 $mailbox_link .=
"/goto.php?target=mail&client_id=".CLIENT_ID;
116 $mmail->autoCheck(
false);
121 $mmail->Body($this->
getBody());