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";
109 $this->additional[$a_lang_id] = array(trim($a_value), (
bool)$a_multiline);
120 public function sendMail(array $a_user_ids, $a_goto_additional = null, $a_permission =
"read")
122 $this->all_ref_ids = null;
130 if(!$this->is_in_wsp)
133 if(
sizeof($ref_ids) == 1)
135 $this->ref_id = array_shift($ref_ids);
139 $this->all_ref_ids = $ref_ids;
143 else if($this->is_in_wsp)
145 $this->ref_id = $this->wsp_tree->lookupNodeId($this->
getObjId());
149 if(!$this->goto_caption)
151 $this->goto_caption =
"url";
155 $recipient_ids = array();
156 foreach(array_unique($a_user_ids) as $user_id)
159 if($this->changed_by == $user_id)
166 $recipient_ids[] = $user_id;
170 return $recipient_ids;
182 public function compose($a_user_id, $a_goto_additional = null, $a_permission =
"read", $a_append_signature_direct =
false)
194 if($this->introduction)
200 if($this->introduction_direct)
202 $this->
appendBody($this->introduction_direct);
218 if(
sizeof($this->additional))
220 foreach($this->additional as $lang_id => $item)
236 $this->body = trim($this->body);
239 if($this->changed_by)
249 if(!$this->
getRefId() && $this->all_ref_ids)
252 foreach($this->all_ref_ids as
$ref_id)
280 $this->ref_id = null;
293 $this->body = trim($this->body);
295 if(!$a_append_signature_direct)
297 $this->
getMail()->appendInstallationSignature(
true);
317 if($this->
compose($a_user_id, $a_goto_additional, $a_permission))
319 parent::sendMail(array($a_user_id), array(
'system'), is_numeric($a_user_id));
334 public function composeAndGetMessage($a_user_id, $a_goto_additional = null, $a_permission =
"read", $a_append_signature_direct =
false)
336 if($this->
compose($a_user_id, $a_goto_additional, $a_permission, $a_append_signature_direct))
getLanguage()
get language object
setBody($a_body)
Set mail body.
sendMail(array $a_user_ids, $a_goto_additional=null, $a_permission="read")
Send notification(s)
getLanguageText($a_keyword)
Replace new lines.
initLanguage($a_usr_id)
Init language.
addAdditionalInfo($a_lang_id, $a_value, $a_multiline=false)
Add additional information.
isRefIdAccessible($a_user_id, $a_ref_id, $a_permission="read")
Check if ref id is accessible for user.
setSubject($a_subject)
Set mail subject.
static _getAllReferences($a_id)
get all reference ids of object
setChangedByUserId($a_id)
Set changed by user id.
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)
Default behaviour is:
Base class for course/group mail notifications.
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)
Get object title.
static getSalutation($a_usr_id, $a_language=null)
Get salutation.
getObjType()
Get object type.
setIntroductionLangId($a_lang_id)
Set introduction lang id.
getRefId()
get reference id
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='')
Create a permanent link for an object.
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.
getMail()
Get mail object.
setReasonLangId($a_lang_id)
Set reason lang id.
static _getAutoGeneratedMessageString($lang=null)
get auto generated info string
Wrapper classes for system notifications.
setGotoLangId($a_lang_id)
Set goto lang id.
static _getInstallationSignature()
Static getter for the installation signature.