34 $this->lang_variables_as_fallback = $a_status;
63 $this->data = $a_data;
79 if (!is_array($this->amail[$a_lang])) {
81 $this->amail[
"body"] = trim($this->amail[
"body"]);
82 $this->amail[
"subject"] = trim($this->amail[
"subject"]);
85 return $this->amail[$a_lang];
96 public function send()
103 if ($amail[
'body'] ==
'' || $amail[
'subject'] ==
'') {
105 $lang = $DIC->settings()->get(
'language');
107 $lang = $this->data[
'language'];
112 ($amail[
'body'] ==
'' || $amail[
'subject'] ==
'')) {
113 $lang = $this->data[
'language'];
117 $mail_subject = $tmp_lang->txt(
'disk_quota_mail_subject');
120 $mail_body = $tmp_lang->txt(
'disk_quota_mail_body_salutation') .
' ' .
$data[
'firstname'] .
' ' .
$data[
'lastname'] .
",\n\n" .
121 $tmp_lang->txt(
'disk_quota_body_text1') .
"\n\n" .
122 $tmp_lang->txt(
'disk_quota_body_text2') .
"\n" .
124 $mail_body .= $tmp_lang->txt(
'login') .
': ' .
$data[
'firstname'] .
"\n";
126 $mail_body .= $tmp_lang->txt(
'disk_quota_mail_body_text3') .
"\n\r";
135 $senderFactory =
$GLOBALS[
"DIC"][
"mail.mime.sender.factory"];
138 include_once
'Services/Mail/classes/class.ilMimeMail.php';
140 $mmail->From($senderFactory->system());
141 $mmail->Subject($mail_subject);
142 $mmail->To($this->data[
'email']);
143 $mmail->Body($mail_body);
146 include_once
'Services/Mail/classes/class.ilMail.php';
148 $mail->enqueue($this->data[
'login'],
"",
"", $mail_subject, $mail_body, array());
157 if ($this->tmp_lng == null || $this->tmp_lng->lang_key != $a_lang) {
167 $tmp_lang = $this->
getLng($a_lang);
170 switch ($this->data[
'gender']) {
171 case "f": $gender_salut = $a_amail[
"sal_f"];
173 case "m": $gender_salut = $a_amail[
"sal_m"];
175 default: $gender_salut = $a_amail[
"sal_g"];
177 $gender_salut = trim($gender_salut);
179 $a_string = str_replace(
"[MAIL_SALUTATION]", $gender_salut, $a_string);
180 $a_string = str_replace(
"[LOGIN]", $this->data[
'login'], $a_string);
181 $a_string = str_replace(
"[FIRST_NAME]", $this->data[
'firstname'], $a_string);
182 $a_string = str_replace(
"[LAST_NAME]", $this->data[
'lastname'], $a_string);
184 $a_string = str_replace(
"[EMAIL]", $this->data[
'email'], $a_string);
185 $a_string = str_replace(
190 $a_string = str_replace(
"[CLIENT_NAME]", CLIENT_NAME, $a_string);
191 $a_string = str_replace(
193 $DIC->settings()->get(
"admin_email"),
197 $a_string = str_replace(
"[DISK_QUOTA]",
ilUtil::formatSize($this->data[
'disk_quota'],
'short', $tmp_lang), $a_string);
198 $a_string = str_replace(
"[DISK_USAGE]",
ilUtil::formatSize($this->data[
'disk_usage'],
'short', $tmp_lang), $a_string);
200 $disk_usage_details =
'';
201 foreach ($this->data[
'disk_usage_details'] as $details) {
202 $disk_usage_details .= number_format($details[
'count'], 0) .
' ' .
203 $tmp_lang->txt($details[
'type']) .
' ' .
206 $a_string = str_replace(
"[DISK_USAGE_DETAILS]", $disk_usage_details, $a_string);
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)
useLangVariablesAsFallback($a_status)
setData($a_data)
Sets used to fill in the placeholders in the mail.
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Class ilDiskQuotaReminderMail.
replacePlaceholders($a_string, $a_amail, $a_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()
catch(ilCmiXapiException $e) send($response)
$data
Data used to fill in the placeholders in the mail.