4 include_once
'Services/Mail/classes/class.ilMailNotification.php';
5 include_once
'Services/Mail/classes/class.ilMimeMail.php';
20 $last_run = $setting->get(get_class($this));
23 if($last_run == date(
"Y-m-d"))
30 $set = $ilDB->query(
"SELECT usr_id,keyword FROM usr_pref".
31 " WHERE ".$ilDB->like(
"keyword",
"text",
"grpcrs_ntf_%").
32 " AND value = ".$ilDB->quote(
"1",
"text"));
33 while(
$row = $ilDB->fetchAssoc($set))
47 include_once
"Services/News/classes/class.ilNewsItem.php";
48 foreach($objects as
$type => $ref_ids)
51 foreach($ref_ids as
$ref_id => $user_ids)
55 if($news_item->checkNewsExistsForGroupCourse(
$ref_id))
57 foreach($user_ids as $user_id)
60 $user_news = $news_item->getNewsForRefId(
$ref_id,
61 false,
false, 1,
false,
false,
false,
false,
76 $setting->set(get_class($this), date(
"Y-m-d"));
88 public function sendMail($a_user_id, $a_ref_id, array $news)
119 foreach($news as $item)
122 $item[
"title"], $item[
"content_is_lang_var"], $item[
"agg_ref_id"],
123 $item[
"aggregation"]);
125 $item[
"content"], $item[
"content_text_is_lang_var"]);
161 $cont_loc->addContextItems($item[
"ref_id"],
true);
162 $cont_loc->setTextOnly(
true);
163 $loc =
"[".$cont_loc->getHTML().
"]";
165 $this->
appendBody(
"----------------------------------------------------------------------------------------------");
167 $this->
appendBody(
'#'.$counter.
" - ".$loc.
" ".$obj_title.
"\n\n");
178 $this->
appendBody(
"----------------------------------------------------------------------------------------------");
185 $object_link .=
"/goto.php?target=".$obj_type.
"_".$a_ref_id.
186 "&client_id=".CLIENT_ID;
194 $mmail->autoCheck(
false);
195 $mmail->From(
'noreply');
199 $mmail->Body($this->
getBody());