45 global $ilias, $rbacsystem;
53 include_once
"Services/Mail/classes/class.ilMail.php";
54 include_once
'./Services/User/classes/class.ilObjUser.php';
55 include_once
"./Services/Language/classes/class.ilLanguage.php";
57 $query =
"SELECT mail.* "
59 .
"INNER JOIN mail ON mail.user_id = mail_options.user_id "
60 .
"INNER JOIN mail_obj_data ON mail_obj_data.obj_id = mail.folder_id "
62 .
"AND cronjob_notification = '1' "
63 .
"AND send_time >= '" . date(
"Y-m-d H:i:s", time() - 60 * 60 * 24).
"' "
64 .
"AND mail_obj_data.type = 'inbox' "
65 .
"AND m_status = 'unread' "
68 $res = $this->db->query($query);
75 if ($user_id == 0 || $row[
'user_id'] != $user_id) $user_id = $row[
'user_id'];
77 $users[$user_id][] = $row;
81 foreach ($users as $user_id => $mail_data)
83 $tmp_mail_obj =
new ilMail($user_id);
85 include_once
"Services/Mail/classes/class.ilMimeMail.php";
88 $mmail->autoCheck(
false);
89 $mmail->From(
'noreply');
91 $mmail->Subject($tmp_mail_obj->formatNotificationSubject());
92 $mmail->Body($tmp_mail_obj->formatNotificationMessage($user_id, $mail_data));
101 $this->log->write(__METHOD__.
': Send '.$numRows.
' messages.');