34 $this->lang_variables_as_fallback = $a_status;
63 $this->
data = $a_data;
79 if (!is_array($this->amail[$a_lang]))
81 require_once(
'./Services/WebDAV/classes/class.ilObjDiskQuotaSettings.php');
83 $this->amail[
"body"] = trim($this->amail[
"body"]);
84 $this->amail[
"subject"] = trim($this->amail[
"subject"]);
87 return $this->amail[$a_lang];
105 if ($amail[
'body'] ==
'' || $amail[
'subject'] ==
'')
108 $lang = $ilSetting->get(
'language');
117 ($amail[
'body'] ==
'' || $amail[
'subject'] ==
''))
123 $mail_subject = $tmp_lang->txt(
'disk_quota_mail_subject');
126 $mail_body = $tmp_lang->txt(
'disk_quota_mail_body_salutation').
' '.
$data[
'firstname'].
' '.
$data[
'lastname'].
",\n\n".
127 $tmp_lang->txt(
'disk_quota_body_text1').
"\n\n".
128 $tmp_lang->txt(
'disk_quota_body_text2').
"\n".
129 ILIAS_HTTP_PATH.
'/login.php?client_id='.CLIENT_ID.
"\n";
130 $mail_body .= $tmp_lang->txt(
'login').
': '.
$data[
'firstname'].
"\n";
132 $mail_body .= $tmp_lang->txt(
'disk_quota_mail_body_text3').
"\n\r";
143 include_once
'Services/Mail/classes/class.ilMimeMail.php';
145 $mmail->autoCheck(
false);
146 $mmail->From($ilSetting->get(
'admin_email'));
147 $mmail->Subject($mail_subject);
148 $mmail->To($this->
data[
'email']);
149 $mmail->Body($mail_body);
152 include_once
'Services/Mail/classes/class.ilMail.php';
154 $mail->sendMail($this->
data[
'login'],
"",
"",$mail_subject,$mail_body,
array(),
array(
"normal"));
162 if ($this->tmp_lng == null || $this->tmp_lng->lang_key != $a_lang)
173 $tmp_lang = $this->
getLng($a_lang);
176 switch ($this->
data[
'gender'])
178 case "f" : $gender_salut = $a_amail[
"sal_f"];
180 case "m" : $gender_salut = $a_amail[
"sal_m"];
182 default : $gender_salut = $a_amail[
"sal_g"];
184 $gender_salut = trim($gender_salut);
186 $a_string = str_replace(
"[MAIL_SALUTATION]", $gender_salut, $a_string);
187 $a_string = str_replace(
"[LOGIN]", $this->
data[
'login'], $a_string);
188 $a_string = str_replace(
"[FIRST_NAME]", $this->
data[
'firstname'], $a_string);
189 $a_string = str_replace(
"[LAST_NAME]", $this->
data[
'lastname'], $a_string);
191 $a_string = str_replace(
"[EMAIL]", $this->
data[
'email'], $a_string);
192 $a_string = str_replace(
"[ILIAS_URL]",
193 ILIAS_HTTP_PATH.
"/login.php?client_id=".CLIENT_ID, $a_string);
194 $a_string = str_replace(
"[CLIENT_NAME]", CLIENT_NAME, $a_string);
195 $a_string = str_replace(
"[ADMIN_MAIL]", $ilSetting->get(
"admin_email"),
198 $a_string = str_replace(
"[DISK_QUOTA]",
ilUtil::formatSize($this->
data[
'disk_quota'],
'short',$tmp_lang), $a_string);
199 $a_string = str_replace(
"[DISK_USAGE]",
ilUtil::formatSize($this->
data[
'disk_usage'],
'short',$tmp_lang), $a_string);
201 $disk_usage_details =
'';
202 foreach ($this->
data[
'disk_usage_details'] as $details)
204 $disk_usage_details .= number_format($details[
'count'], 0).
' '.
205 $tmp_lang->txt($details[
'type']).
' '.
208 $a_string = str_replace(
"[DISK_USAGE_DETAILS]", $disk_usage_details, $a_string);
send()
Sends the mail with its object properties as MimeMail It first tries to read the mail body...
static _lookupReminderMailTemplate($a_lang)
Looks up the mail template for the specified language.
$lang_variables_as_fallback
readMailTemplate($a_lang)
get new mail template array (including subject and message body)
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
useLangVariablesAsFallback($a_status)
setData($a_data)
Sets used to fill in the placeholders in the mail.
this class encapsulates the PHP mail() function.
This class handles base functions for mail handling.
Create styles array
The data for the language used.
Class ilDiskQuotaReminderMail.
replacePlaceholders($a_string, $a_amail, $a_lang)
for($i=1; $i<=count($kw_cases_sel); $i+=1) $lang
static formatSize($size, $a_mode='short', $a_lng=null)
Returns the specified file size value in a human friendly form.
__construct()
constructor public
areLangVariablesUsedAsFallback()
$data
Data used to fill in the placeholders in the mail.