Commit 024a2a92 authored by Fabian Galinski's avatar Fabian Galinski 😾
Browse files

[BUGFIX] The placeholders of the mail subject aren't replaced

parent f25c625a
......@@ -697,12 +697,21 @@ class MailTemplateService {
$emailView->assignMultiple($this->markers);
$emailView->assign('all_fields', $this->getAllMarker($this->markers));
$overwrittenEmailBody = $this->getOverwrittenEmailBody();
$overwrittenSubject = '';
if ($this->subject !== '' && $this->subject !== NULL) {
$overwrittenSubject = $this->subject;
}
if ($template !== NULL) {
$emailView->setTemplateSource(\trim($template->getSubject()));
$emailView->setTemplateSource(
\trim(empty($overwrittenSubject) ? $template->getSubject() : $overwrittenSubject)
);
$subject = $emailView->render();
$overwrittenEmailBody = $this->getOverwrittenEmailBody();
$emailView->setTemplateSource(empty($overwrittenEmailBody) ? $template->getContent() : $overwrittenEmailBody);
$emailView->setTemplateSource(
empty($overwrittenEmailBody) ? $template->getContent() : $overwrittenEmailBody
);
} else {
$subject = $registerService->getRegisterArray()[$this->extensionKey][$this->templateName]['subject'];
if (\is_array($subject)) {
......@@ -711,18 +720,13 @@ class MailTemplateService {
[$this->extensionKey][$this->templateName]['subject'][$this->language]
);
}
if ($subject === NULL && $this->subject !== NULL) {
$subject = $this->subject;
}
if ($subject !== NULL) {
$emailView->setTemplateSource($subject);
$subject = $emailView->render();
}
$emailView->setTemplateSource(empty($overwrittenEmailBody) ? $defaultTemplateContent : $overwrittenEmailBody);
}
if ($this->subject !== '' && $this->subject !== NULL) {
$subject = $this->subject;
$emailView->setTemplateSource(empty($overwrittenSubject) ? $subject : $overwrittenSubject);
$subject = $emailView->render();
$emailView->setTemplateSource(
empty($overwrittenEmailBody) ? $defaultTemplateContent : $overwrittenEmailBody
);
}
$this->mailMessage->setSubject($subject);
......
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