ILIAS
trunk Revision v13.0_alpha-62-g3b72d83f2e5
◀ ilDoc Overview
PlainTextMailBodyComposer.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
namespace
ILIAS\Mail\Mime\Presentation
;
22
23
use
ILIAS\Mail\Mime\Presentation\Asset\InlineImages
;
24
29
final
class
PlainTextMailBodyComposer
implements
MailBodyComposer
30
{
32
private
const
array
LINE_BREAKS
= [
'<br />'
,
'<br>'
,
'<br/>'
];
33
34
public
function
compose
(
MailBodySource
$source):
ComposedMailBody
35
{
36
$without_breaks = str_ireplace(self::LINE_BREAKS,
"\n"
, $source->
raw
());
37
$plain_text = html_entity_decode(strip_tags($without_breaks), ENT_QUOTES);
38
39
return
new
ComposedMailBody
($plain_text,
null
,
InlineImages::none
());
40
}
41
}
ILIAS\Mail\Mime\Presentation\Asset\InlineImages
<string, InlineImage>
Definition:
InlineImages.php:27
ILIAS\Mail\Mime\Presentation\Asset\InlineImages\none
static none()
Definition:
InlineImages.php:37
ILIAS\Mail\Mime\Presentation\ComposedMailBody
Definition:
ComposedMailBody.php:26
ILIAS\Mail\Mime\Presentation\MailBodySource
Definition:
MailBodySource.php:24
ILIAS\Mail\Mime\Presentation\MailBodySource\raw
raw()
Definition:
MailBodySource.php:34
ILIAS\Mail\Mime\Presentation\PlainTextMailBodyComposer
Turns a mail body into plain text, for installations with HTML mails disabled and for the alternative...
Definition:
PlainTextMailBodyComposer.php:30
ILIAS\Mail\Mime\Presentation\PlainTextMailBodyComposer\compose
compose(MailBodySource $source)
Definition:
PlainTextMailBodyComposer.php:34
ILIAS\Mail\Mime\Presentation\PlainTextMailBodyComposer\LINE_BREAKS
const array LINE_BREAKS
Definition:
PlainTextMailBodyComposer.php:32
ILIAS\Mail\Mime\Presentation\MailBodyComposer
Definition:
MailBodyComposer.php:24
ILIAS\Mail\Mime\Presentation
components
ILIAS
Mail
src
Mime
Presentation
PlainTextMailBodyComposer.php
Generated on Wed Nov 11 2026 23:08:10 for ILIAS by
1.9.4 (using
Doxyfile
)