13 include_once
"Services/Mail/classes/class.ilMail.php";
36 if (empty($this->mail_data)) {
40 $bodylines = preg_split(
"/\r\n|\n|\r/", $this->mail_data[
"m_message"]);
41 for (
$i = 0;
$i < count($bodylines);
$i++) {
42 $bodylines[
$i] =
"> " . $bodylines[
$i];
45 return $this->mail_data[
"m_message"] = implode(chr(10), $bodylines);
55 if (empty($this->mail_data)) {
58 return $this->mail_data[
"m_subject"] =
"RE: " . $this->mail_data[
"m_subject"];
70 if (empty($this->mail_data)) {
76 $currentUserLogin = $DIC->user()->getLogin();
78 foreach (explode(
',', $this->mail_data[
'rcp_to']) as $to) {
79 if (trim($to) !=
'' && $currentUserLogin != trim($to)) {
84 foreach (explode(
',', $this->mail_data[
'rcp_cc']) as $cc) {
85 if (trim($cc) !=
'' && $currentUserLogin != trim($cc)) {
90 return ($this->mail_data[
'rcp_cc'] = implode(
', ', $newCC));
100 if (empty($this->mail_data)) {
104 require_once
'./Services/User/classes/class.ilObjUser.php';
106 $user =
new ilObjUser($this->mail_data[
"sender_id"]);
107 return $this->mail_data[
"rcp_to"] = $user->getLogin();
116 if (empty($this->mail_data)) {
119 return $this->mail_data[
"m_subject"] =
"[FWD: " . $this->mail_data[
"m_subject"] .
"]";
131 if (empty($this->mail_data)) {
134 $name_str = implode(
',', $a_names);
137 $this->mail_data[
"rcp_to"] = trim($this->mail_data[
"rcp_to"]);
138 if ($this->mail_data[
"rcp_to"]) {
139 $this->mail_data[
"rcp_to"] = $this->mail_data[
"rcp_to"] .
",";
141 $this->mail_data[
"rcp_to"] = $this->mail_data[
"rcp_to"] . $name_str;
145 $this->mail_data[
"rcp_cc"] = trim($this->mail_data[
"rcp_cc"]);
146 if ($this->mail_data[
"rcp_cc"]) {
147 $this->mail_data[
"rcp_cc"] = $this->mail_data[
"rcp_cc"] .
",";
149 $this->mail_data[
"rcp_cc"] = $this->mail_data[
"rcp_cc"] . $name_str;
153 $this->mail_data[
"rcp_bcc"] = trim($this->mail_data[
"rcp_bcc"]);
154 if ($this->mail_data[
"rcp_bcc"]) {
155 $this->mail_data[
"rcp_bcc"] = $this->mail_data[
"rcp_bcc"] .
",";
157 $this->mail_data[
"rcp_bcc"] = $this->mail_data[
"rcp_bcc"] . $name_str;
172 $linebreak = $this->mail_options->getLinebreak();
174 $lines = explode(chr(10), $message);
175 for (
$i = 0;
$i < count($lines);
$i++) {
176 if (substr($lines[
$i], 0, 1) !=
'>') {
177 $formatted[] = wordwrap($lines[$i], $linebreak, chr(10));
179 $formatted[] = $lines[
$i];
182 $formatted = implode(chr(10), $formatted);
192 $message = (string) ($this->mail_data[
'm_message'] ??
'');
193 $message .= chr(13) . chr(10) . $this->mail_options->getSignature();
203 $message = (string) ($this->mail_data[
'm_message'] ??
'');
204 $message = $this->mail_options->getSignature() . chr(13) . chr(10) . chr(13) . chr(10) .
$message;
__construct(Container $dic, ilPlugin $plugin)