19 declare(strict_types=1);
32 public function __construct(
bool $a_is_personal_workspace =
false)
35 $this->db = $DIC->database();
36 $this->
lng = $DIC->language();
38 $this->senderFactory = $DIC->mail()->mime()->senderFactory();
43 public function send(): void
45 $is_message_enabled = (bool) $this->
settings->get(
'mail_notification_message',
'0');
47 $res = $this->db->queryF(
48 'SELECT mail.* FROM mail_options 49 INNER JOIN mail ON mail.user_id = mail_options.user_id 50 INNER JOIN mail_obj_data ON mail_obj_data.obj_id = mail.folder_id 51 INNER JOIN usr_data ud ON ud.usr_id = mail.user_id 52 WHERE mail_options.cronjob_notification = %s 53 AND mail.send_time >= %s 54 AND mail.m_status = %s 56 [
'integer',
'timestamp',
'text',
'integer'],
57 [1, date(
'Y-m-d H:i:s', time() - 60 * 60 * 24),
'unread', 1]
63 while ($row = $this->db->fetchAssoc(
$res)) {
69 $sender = $this->senderFactory->system();
71 foreach ($users as
$user_id => $mail_data) {
82 if (count($mail_data) === 1) {
84 $user_lang->txt(
'mail_at_the_ilias_installation'),
90 $user_lang->txt(
'mails_at_the_ilias_installation'),
98 foreach ($mail_data as
$mail) {
100 '----------------------------------------------------------------------------------------------' 104 $this->
appendBody($user_lang->txt(
'date') .
': ' . $mail[
'send_time']);
111 $this->
appendBody($user_lang->txt(
'sender') .
': ' . $senderName);
113 $this->
appendBody($user_lang->txt(
'subject') .
': ' . $mail[
'm_subject']);
116 if ($is_message_enabled) {
117 $this->
appendBody($user_lang->txt(
'message') .
': ' . $mail[
'm_message']);
123 '----------------------------------------------------------------------------------------------' 126 $this->
appendBody($user_lang->txt(
'follow_link_to_read_mails') .
' ');
129 $mailbox_link .=
'/goto.php?target=mail&client_id=' .
CLIENT_ID;
140 $mmail->To($mailOptions->getExternalEmailAddresses());
143 $mmail->Body($this->
getBody());
appendBody(string $a_body)
static _getIliasMailerName()
static _getAutoGeneratedMessageString(?ilLanguage $lang=null)
__construct(bool $a_is_personal_workspace=false)
static getSalutation(int $a_usr_id, ?ilLanguage $a_language=null)
initLanguage(int $a_usr_id)
ilMailMimeSenderFactory $senderFactory
getLanguageText(string $a_keyword)
setRecipients(array $a_rcp)
__construct(Container $dic, ilPlugin $plugin)
setSubject(string $a_subject)
static _getInstallationSignature()
static _lookupLogin(int $a_user_id)