16 include_once
'Services/Mail/classes/class.ilMail.php';
17 include_once
'Services/User/classes/class.ilObjUser.php';
18 include_once
'Services/Language/classes/class.ilLanguage.php';
19 include_once
'Services/Mail/classes/class.ilMimeMail.php';
21 $res = $ilDB->queryF(
'SELECT mail.* FROM mail_options
22 INNER JOIN mail ON mail.user_id = mail_options.user_id
23 INNER JOIN mail_obj_data ON mail_obj_data.obj_id = mail.folder_id
24 WHERE cronjob_notification = %s
26 AND mail_obj_data.m_type = %s
28 array(
'integer',
'timestamp',
'text',
'text'),
29 array(1, date(
'Y-m-d H:i:s', time() - 60 * 60 * 24),
'inbox',
'unread')
35 while(
$row = $ilDB->fetchAssoc(
$res))
37 if($user_id == 0 ||
$row[
'user_id'] != $user_id) $user_id =
$row[
'user_id'];
38 $users[$user_id][] =
$row;
42 foreach($users as $user_id => $mail_data)
44 $tmp_mail_obj =
new ilMail($user_id);
47 $mmail->autoCheck(
false);
48 $mmail->From(
'noreply');
50 $mmail->Subject($tmp_mail_obj->formatNotificationSubject());
51 $mmail->Body($tmp_mail_obj->formatNotificationMessage($user_id, $mail_data));
59 $ilLog->write(__METHOD__.
': Send '.$numRows.
' messages.');