19 declare(strict_types=1);
36 public function subject(
string $subject,
bool $addPrefix =
false,
string $contextPrefix =
''): string
38 $subject = trim($subject);
39 $contextPrefix = trim($contextPrefix);
43 $globalPrefix = $this->
settings->get(
'mail_subject_prefix');
44 if (!is_string($globalPrefix)) {
47 $globalPrefix = trim($globalPrefix);
49 $prefix = $globalPrefix;
50 if ($contextPrefix !==
'') {
51 $prefix = str_replace([
'[',
']',],
'', $prefix);
53 $prefix =
'[' . $prefix .
' : ' . $contextPrefix .
']';
55 $prefix =
'[' . $contextPrefix .
']';
59 if ($prefix && $prefix !==
'') {
60 $subject = $prefix .
' ' . $subject;
Class ilMailMimeSubjectBuilder.
__construct(ilSetting $settings, string $defaultPrefix)
subject(string $subject, bool $addPrefix=false, string $contextPrefix='')