19 declare(strict_types=1);
36 if (empty($this->mail_data)) {
42 $currentUserLogin = $DIC->user()->getLogin();
44 foreach (explode(
',', $this->mail_data[
'rcp_to']) as $to) {
46 if ($to !==
'' && $currentUserLogin !== $to) {
51 foreach (explode(
',', $this->mail_data[
'rcp_cc']) as $cc) {
53 if ($cc !==
'' && $currentUserLogin !== $cc) {
58 return $this->mail_data[
'rcp_cc'] = implode(
', ', $newCC);
63 if (empty($this->mail_data)) {
67 $user =
new ilObjUser((
int) $this->mail_data[
'sender_id']);
68 return $this->mail_data[
'rcp_to'] = $user->getLogin();
78 $name_str = implode(
',', $a_names);
81 if (
'cc' === $a_type) {
83 } elseif (
'bc' === $a_type) {
87 if (!isset($this->mail_data[
$key]) || !is_string($this->mail_data[$key])) {
88 $this->mail_data[
$key] =
'';
90 $this->mail_data[
$key] = trim($this->mail_data[$key]);
93 if ($this->mail_data[$key] !==
'') {
94 $this->mail_data[
$key] .=
',';
96 $this->mail_data[
$key] .= $name_str;
105 $linebreak = $this->mail_options->getLinebreak();
107 $lines = explode(chr(10), $message);
108 foreach ($lines as $iValue) {
109 if (strpos($iValue,
'>') !== 0) {
110 $formatted[] = wordwrap($iValue, $linebreak, chr(10));
112 $formatted[] = $iValue;
115 return implode(chr(10), $formatted);
120 $message .= chr(13) . chr(10) . $this->mail_options->getSignature();
127 return $this->mail_options->getSignature() .
137 $bodylines = preg_split(
"/\r\n|\n|\r/", $message);
138 foreach ($bodylines as
$i => $iValue) {
139 $bodylines[
$i] =
'> ' . $iValue;
142 return implode(chr(10), $bodylines);
147 return 'RE: ' . $subject;
152 return '[FWD: ' . $subject .
']';
__construct(Container $dic, ilPlugin $plugin)