ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
ConfiguredMailBodyComposer.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
23use Closure;
24use ilSetting;
25
29final readonly class ConfiguredMailBodyComposer implements MailBodyComposer
30{
36 public function __construct(
37 private ilSetting $settings,
38 private Closure $html_composer,
39 private MailBodyComposer $plain_text_composer
40 ) {
41 }
42
43 public function compose(MailBodySource $source): ComposedMailBody
44 {
45 if ($this->settings->get('mail_send_html', '0')) {
46 return ($this->html_composer)()->compose($source);
47 }
48
49 return $this->plain_text_composer->compose($source);
50 }
51}
$settings
Definition: index.php:44
Composes the body in whichever format the installation is configured to send.
__construct(private ilSetting $settings, private Closure $html_composer, private MailBodyComposer $plain_text_composer)
ILIAS Setting Class.