Definition at line 23 of file class.ilMimeMail.php.
◆ __construct()
| ilMimeMail::__construct |
( |
| ) |
|
◆ Attach()
| ilMimeMail::Attach |
( |
string |
$filename, |
|
|
string |
$file_type = '', |
|
|
string |
$disposition = 'inline', |
|
|
?string |
$display_name = null |
|
) |
| |
- Parameters
-
| string | $filename | Path of the file to attach |
| string | $file_type | MIME-type of the file. default to 'application/x-unknown-content-type' |
| string | $disposition | Instruct the Mailclient to display the file if possible ("inline") or always as a link ("attachment") possible values are "inline", "attachment" |
| string | null | $display_name | Filename to use in email (if different from source file) |
Definition at line 178 of file class.ilMimeMail.php.
183 : void {
184 if ($file_type === '') {
185 $file_type = 'application/octet-stream';
186 }
187
189 $this->actype[] = $file_type;
190 $this->adispo[] = $disposition;
191 $this->adisplay[] = $display_name;
192 }
◆ Bcc()
- Parameters
-
| string | string[] | $bcc | BCC email address, accept both a single address or an array of addresses |
Definition at line 118 of file class.ilMimeMail.php.
118 : void
119 {
120 if (is_array($bcc)) {
121 $this->abcc = $bcc;
122 } else {
123 $this->abcc[] = $bcc;
124 }
125 }
◆ Body()
| ilMimeMail::Body |
( |
string |
$body | ) |
|
◆ build()
Definition at line 227 of file class.ilMimeMail.php.
227 : void
228 {
230
231 $this->finalBodyAlt = '';
232 $this->finalBody = '';
233 $this->images = [];
234
235 if (
$DIC->settings()->get(
'mail_send_html',
'0')) {
236 $skin =
$DIC[
'ilClientIniFile']->readVariable(
'layout',
'skin');
237
240 } else {
242 }
243 }
buildHtmlInlineImages(string $skin)
buildBodyMultiParts(string $skin)
removeHTMLTags(string $maybeHTML)
References $DIC.
◆ buildBodyMultiParts()
| ilMimeMail::buildBodyMultiParts |
( |
string |
$skin | ) |
|
|
protected |
Definition at line 252 of file class.ilMimeMail.php.
252 : void
253 {
254 if ($this->body === '') {
255 $this->body = ' ';
256 }
257
258 if (strip_tags($this->body, '<b><u><i><a>') === $this->body) {
259
260
261
262 $this->finalBodyAlt = strip_tags($this->body);
263 $this->body = $this->
refinery->string()->makeClickable()->transform(nl2br($this->body));
264 } else {
265
266 $this->finalBodyAlt = strip_tags(str_ireplace(["<br />", "<br>", "<br/>"], "\n", $this->body));
267 }
268
269 $this->finalBody = str_replace(
'{PLACEHOLDER}', $this->body, $this->
getHtmlEnvelope($skin));
270 }
getHtmlEnvelope(string $skin)
References ILIAS\Repository\refinery().
◆ buildHtmlInlineImages()
| ilMimeMail::buildHtmlInlineImages |
( |
string |
$skin | ) |
|
|
protected |
Definition at line 287 of file class.ilMimeMail.php.
287 : void
288 {
289 $this->gatherImagesFromDirectory('./Services/Mail/templates/default/img');
290
291 if ($skin !== 'default') {
292 $skinDirectory = './Customizing/global/skin/' . $skin . '/Services/Mail/img';
293 if (is_dir($skinDirectory) && is_readable($skinDirectory)) {
294 $this->gatherImagesFromDirectory($skinDirectory, true);
295 }
296 }
297 }
◆ Cc()
- Parameters
-
| string | string[] | $cc | CC email address, accept both a single address or an array of addresses |
Definition at line 106 of file class.ilMimeMail.php.
106 : void
107 {
108 if (is_array($cc)) {
109 $this->acc = $cc;
110 } else {
111 $this->acc[] = $cc;
112 }
113 }
◆ From()
◆ getAttachments()
| ilMimeMail::getAttachments |
( |
| ) |
|
- Returns
- array{path: string, name: string}[]
Definition at line 197 of file class.ilMimeMail.php.
197 : array
198 {
199 $attachments = [];
200
202 foreach ($this->aattach as $attachment) {
204 if (isset($this->adisplay[
$i]) && is_string($this->adisplay[
$i]) && $this->adisplay[
$i] !==
'') {
206 }
207
208 $attachments[] = [
209 'path' => $attachment,
211 ];
213 }
214
215 return $attachments;
216 }
References $i, and $name.
Referenced by ilMailMimeTransportBase\send().
◆ getBcc()
◆ getCc()
◆ getDefaultTransport()
| static ilMimeMail::getDefaultTransport |
( |
| ) |
|
|
static |
◆ getFinalBody()
| ilMimeMail::getFinalBody |
( |
| ) |
|
◆ getFinalBodyAlt()
| ilMimeMail::getFinalBodyAlt |
( |
| ) |
|
◆ getFrom()
◆ getHtmlEnvelope()
| ilMimeMail::getHtmlEnvelope |
( |
string |
$skin | ) |
|
|
protected |
Definition at line 272 of file class.ilMimeMail.php.
272 : string
273 {
274 $bracket_path = './Services/Mail/templates/default/tpl.html_mail_template.html';
275
276 if ($skin !== 'default') {
277 $tplpath = './Customizing/global/skin/' . $skin . '/Services/Mail/tpl.html_mail_template.html';
278
279 if (is_file($tplpath)) {
280 $bracket_path = './Customizing/global/skin/' . $skin . '/Services/Mail/tpl.html_mail_template.html';
281 }
282 }
283
284 return file_get_contents($bracket_path);
285 }
◆ getImages()
| ilMimeMail::getImages |
( |
| ) |
|
- Returns
- array{path: string, cid: string, name: string}[] An array of images. Each element must container to associative keys, 'path', 'cid' and 'name'
Definition at line 222 of file class.ilMimeMail.php.
222 : array
223 {
224 return array_values($this->images);
225 }
Referenced by ilMailMimeTransportBase\send().
◆ getSubject()
| ilMimeMail::getSubject |
( |
| ) |
|
◆ getTo()
◆ removeHTMLTags()
| ilMimeMail::removeHTMLTags |
( |
string |
$maybeHTML | ) |
|
|
private |
Definition at line 245 of file class.ilMimeMail.php.
245 : string
246 {
247 $maybeHTML = str_ireplace(['<br />', '<br>', '<br/>'], "\n", $maybeHTML);
248
249 return strip_tags($maybeHTML);
250 }
◆ Send()
Definition at line 320 of file class.ilMimeMail.php.
320 : bool
321 {
324 }
325
327
328 return $transport->
send($this);
329 }
static getDefaultTransport()
◆ setDefaultTransport()
◆ Subject()
| ilMimeMail::Subject |
( |
string |
$subject, |
|
|
bool |
$addPrefix = false, |
|
|
string |
$contextPrefix = '' |
|
) |
| |
◆ To()
- Parameters
-
| string | string[] | $to | To email address, accept both a single address or an array of addresses |
Definition at line 94 of file class.ilMimeMail.php.
94 : void
95 {
96 if (is_array($to)) {
97 $this->sendto = $to;
98 } else {
99 $this->sendto[] = $to;
100 }
101 }
◆ $aattach
| array ilMimeMail::$aattach = [] |
|
protected |
◆ $abcc
| array ilMimeMail::$abcc = [] |
|
protected |
◆ $acc
| array ilMimeMail::$acc = [] |
|
protected |
◆ $actype
| array ilMimeMail::$actype = [] |
|
protected |
◆ $adisplay
| array ilMimeMail::$adisplay = [] |
|
protected |
◆ $adispo
| array ilMimeMail::$adispo = [] |
|
protected |
◆ $body
| string ilMimeMail::$body = '' |
|
protected |
◆ $defaultTransport
◆ $finalBody
| string ilMimeMail::$finalBody = '' |
|
protected |
◆ $finalBodyAlt
| string ilMimeMail::$finalBodyAlt = '' |
|
protected |
◆ $images
| array ilMimeMail::$images = [] |
|
protected |
◆ $refinery
| Refinery ilMimeMail::$refinery |
|
private |
◆ $sender
◆ $sendto
| array ilMimeMail::$sendto = [] |
|
protected |
◆ $settings
◆ $subject
| string ilMimeMail::$subject = '' |
|
protected |
◆ $subjectBuilder
◆ MAIL_SUBJECT_PREFIX
| const ilMimeMail::MAIL_SUBJECT_PREFIX = '[ILIAS]' |
The documentation for this class was generated from the following file: