Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
No related merge requests found
......@@ -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.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment