ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
PlainTextMailBodyComposer.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
24
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}
Turns a mail body into plain text, for installations with HTML mails disabled and for the alternative...