4 include_once
'./Services/Mail/classes/class.ilMailNotification.php';
5 include_once
'./Services/Mail/classes/class.ilMailOptions.php';
7 include_once
'Services/Mail/classes/class.ilMimeMail.php';
8 include_once
'Services/Mail/classes/class.ilMail.php';
40 $this->db = $DIC->database();
41 $this->lng = $DIC->language();
44 parent::__construct($a_is_personal_workspace);
47 public function send()
49 $is_message_enabled = $this->
settings->get(
"mail_notification_message");
51 $res = $this->db->queryF(
52 'SELECT mail.* FROM mail_options 53 INNER JOIN mail ON mail.user_id = mail_options.user_id 54 INNER JOIN mail_obj_data ON mail_obj_data.obj_id = mail.folder_id 55 INNER JOIN usr_data ud ON ud.usr_id = mail.user_id 56 WHERE mail_options.cronjob_notification = %s 57 AND mail.send_time >= %s 58 AND mail.m_status = %s 60 array(
'integer',
'timestamp',
'text',
'integer'),
61 array(1,
date(
'Y-m-d H:i:s',
time() - 60 * 60 * 24),
'unread', 1)
67 while (
$row = $this->db->fetchAssoc(
$res)) {
68 if ($user_id == 0 ||
$row[
'user_id'] != $user_id) {
69 $user_id =
$row[
'user_id'];
75 $senderFactory =
$GLOBALS[
"DIC"][
"mail.mime.sender.factory"];
76 $sender = $senderFactory->system();
78 foreach (
$users as $user_id => $mail_data) {
89 if (count($mail_data) == 1) {
97 foreach ($mail_data as
$mail) {
98 $this->
appendBody(
"----------------------------------------------------------------------------------------------");
101 $this->
appendBody($user_lang->txt(
'date') .
": " . $mail[
'send_time']);
103 if ($mail[
'sender_id'] == ANONYMOUS_USER_ID) {
104 $senderName = ilMail::_getIliasMailerName();
108 $this->
appendBody($user_lang->txt(
'sender') .
": " . $senderName);
110 $this->
appendBody($user_lang->txt(
'subject') .
": " . $mail[
'm_subject']);
113 if ($is_message_enabled ==
true) {
114 $this->
appendBody($user_lang->txt(
'message') .
": " . $mail[
'm_message']);
119 $this->
appendBody(
"----------------------------------------------------------------------------------------------");
121 $this->
appendBody($user_lang->txt(
'follow_link_to_read_mails') .
" ");
124 $mailbox_link .=
"/goto.php?target=mail&client_id=" . CLIENT_ID;
136 $mmail->Body($this->
getBody());
static _lookupLogin($a_user_id)
lookup login
getLanguageText($a_keyword)
initLanguage($a_usr_id)
Init language.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
__construct($a_is_personal_workspace=false)
{}
Base class for course/group mail notifications.
foreach($_POST as $key=> $value) $res
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
Create styles array
The data for the language used.
setRecipients(array $a_rcp)
static getExternalEmailsByUserId($user_id, ilMailOptions $mail_options=null)
static _getAutoGeneratedMessageString(ilLanguage $lang=null)
Get auto generated info string.
appendBody($a_body)
Append body text.
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
static _getInstallationSignature()
static getSalutation($a_usr_id, ilLanguage $a_language=null)