4 include_once
'./Services/Mail/classes/class.ilMailNotification.php';
35 $this->subject_lang_id = (
string)$a_lang_id;
45 $this->introduction = (
string)$a_lang_id;
55 $this->introduction_direct = trim($a_text);
65 $this->task = (
string)$a_lang_id;
75 $this->reason = (
string)$a_lang_id;
85 $this->goto_caption = (
string)$a_lang_id;
95 $this->changed_by = (int)$a_id;
97 include_once
"Services/User/classes/class.ilUserUtil.php";
108 public function addAdditionalInfo($a_lang_id, $a_value, $a_multiline =
false, $a_lang_direct =
false)
110 $this->additional[$a_lang_id] =
array(trim($a_value), (
bool)$a_multiline, (
bool)$a_lang_direct);
121 public function sendMail(
array $a_user_ids, $a_goto_additional = null, $a_permission =
"read")
123 $this->all_ref_ids = null;
131 if(!$this->is_in_wsp)
134 if(
sizeof($ref_ids) == 1)
136 $this->ref_id = array_shift($ref_ids);
140 $this->all_ref_ids = $ref_ids;
144 else if($this->is_in_wsp)
146 $this->ref_id = $this->wsp_tree->lookupNodeId($this->
getObjId());
150 if(!$this->goto_caption)
152 $this->goto_caption =
"url";
156 $recipient_ids =
array();
157 foreach(array_unique($a_user_ids) as $user_id)
160 if($this->changed_by == $user_id)
167 $recipient_ids[] = $user_id;
171 return $recipient_ids;
183 public function compose($a_user_id, $a_goto_additional = null, $a_permission =
"read", $a_append_signature_direct =
false)
195 if($this->introduction)
201 if($this->introduction_direct)
203 $this->
appendBody($this->introduction_direct);
219 if(
sizeof($this->additional))
221 foreach($this->additional as $lang_id => $item)
226 $caption = (!$item[2])
245 $this->getBlockBorder().
251 $this->body = trim($this->body);
254 if($this->changed_by)
264 if(!$this->
getRefId() && $this->all_ref_ids)
267 foreach($this->all_ref_ids as
$ref_id)
295 $this->ref_id = null;
308 $this->body = trim($this->body);
310 if(!$a_append_signature_direct)
312 $this->
getMail()->appendInstallationSignature(
true);
316 $this->
appendBody(ilMail::_getInstallationSignature());
332 if($this->
compose($a_user_id, $a_goto_additional, $a_permission))
334 parent::sendMail(
array($a_user_id),
array(
'system'), is_numeric($a_user_id));
349 public function composeAndGetMessage($a_user_id, $a_goto_additional = null, $a_permission =
"read", $a_append_signature_direct =
false)
351 if($this->
compose($a_user_id, $a_goto_additional, $a_permission, $a_append_signature_direct))
sendMail(array $a_user_ids, $a_goto_additional=null, $a_permission="read")
Send notification(s)
getLanguageText($a_keyword)
initLanguage($a_usr_id)
Init language.
isRefIdAccessible($a_user_id, $a_ref_id, $a_permission="read")
Check if ref id is accessible for user.
Add rich text string
The name of the decorator.
static _getAllReferences($a_id)
get all reference ids of object
setChangedByUserId($a_id)
Set changed by user id.
Base class for course/group mail notifications.
static getNamePresentation($a_user_id, $a_user_image=false, $a_profile_link=false, $a_profile_back_link="", $a_force_first_lastname=false, $a_omit_login=false, $a_sortable=true, $a_return_data_array=false)
Default behaviour is:
composeAndSendMail($a_user_id, $a_goto_additional=null, $a_permission="read")
Send notification to single recipient.
setIntroductionDirect($a_text)
Set introduction text.
setTaskLangId($a_lang_id)
Set task lang id.
getObjectTitle($a_shorten=false)
getObjType()
Get object type.
setIntroductionLangId($a_lang_id)
Set introduction lang id.
Create styles array
The data for the language used.
addAdditionalInfo($a_lang_id, $a_value, $a_multiline=false, $a_lang_direct=false)
Add additional information.
compose($a_user_id, $a_goto_additional=null, $a_permission="read", $a_append_signature_direct=false)
Compose notification to single recipient.
getBlockBorder()
Get (ascii) block border.
createPermanentLink($a_params=array(), $a_append='')
setSubjectLangId($a_lang_id)
Set subject lang id.
appendBody($a_body)
Append body text.
composeAndGetMessage($a_user_id, $a_goto_additional=null, $a_permission="read", $a_append_signature_direct=false)
Compose notification to single recipient.
setReasonLangId($a_lang_id)
Set reason lang id.
Wrapper classes for system notifications.
setGotoLangId($a_lang_id)
Set goto lang id.