Commit 2ee99037 authored by Kevin Ditscheid's avatar Kevin Ditscheid
Browse files

[FEATURE] Enable subject to contain markers

Add the marker replacement to the subject, so markers can be used
inside the subject, too
parent bb09f2f8
......@@ -325,19 +325,23 @@ class MailTemplateService {
/** @var StandaloneView $emailView */
$emailView = $this->objectManager->get(StandaloneView::class);
$emailView->assignMultiple($this->markers);
if (NULL === $defaultTemplateContent) {
$emailView->setTemplateSource(\trim($template->getSubject()));
$subject = $emailView->render();
$emailView->setTemplateSource($template->getContent());
$subject = trim($template->getSubject());
} else {
$emailView->setTemplateSource($defaultTemplateContent);
$subject = self::getRegisterArray()[$this->extensionKey][$this->templateName]['subject'];
if (is_array($subject)) {
$subject = trim(
if (\is_array($subject)) {
$subject = \trim(
self::getRegisterArray()[$this->extensionKey][$this->templateName]['subject'][$this->language]
);
}
$emailView->setTemplateSource($subject);
$subject = $emailView->render();
$emailView->setTemplateSource($defaultTemplateContent);
}
if ($this->subject !== '' && $this->subject !== NULL) {
......@@ -346,7 +350,6 @@ class MailTemplateService {
$this->mailMessage->setSubject($subject);
$emailView->assignMultiple($this->markers);
$emailBody = $emailView->render();
// insert <br /> tags, but replace every instance of three or more successive breaks with just two.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment