Commit d09e6a97 authored by Torsten Oppermann's avatar Torsten Oppermann
Browse files

[TASK] Fixing Preview Mail, now shows markes

parent df470ae7
......@@ -283,7 +283,7 @@ class MailController extends ActionController {
$mailTemplateService->setTemplateName($selectedTemplateKey);
$mailTemplateService->setExtensionKey($selectedExtensionKey);
if ($mailTemplateService->sendEmail()) {
if ($mailTemplateService->sendEmail(true)) {
$message = LocalizationUtility::translate('backend.success_mail', 'sg_mail');
$this->addFlashMessage($message, '', FlashMessage::OK);
} else {
......
......@@ -193,13 +193,10 @@ class MailTemplateService {
/**
* Send the Email
*
* @param boolean $isPreview
* @return boolean email was sent or added to mail queue successfully?
*/
public function sendEmail() {
$objectManager = GeneralUtility::makeInstance(ObjectManager::class);
/** @var StandaloneView $emailView */
$emailView = $objectManager->get(StandaloneView::class);
public function sendEmail($isPreview = FALSE) {
/** @var Template $template */
$template = $this->templateRepository->findTemplate(
......@@ -219,6 +216,23 @@ class MailTemplateService {
}
}
if ($isPreview) {
if (!isset($defaultTemplateContent)) {
$this->mailMessage->setBody($template->getContent());
$this->mailMessage->setSubject($template->getSubject());
} else {
$this->mailMessage->setBody($defaultTemplateContent);
$this->mailMessage->setSubject('');
}
$this->mailMessage->send();
return TRUE;
}
$objectManager = GeneralUtility::makeInstance(ObjectManager::class);
/** @var StandaloneView $emailView */
$emailView = $objectManager->get(StandaloneView::class);
if (!isset($defaultTemplateContent)) {
$emailView->setTemplateSource($template->getContent());
$this->mailMessage->setSubject($template->getSubject());
......
......@@ -34,7 +34,7 @@
<source>Language (Reloads the page):</source>
</trans-unit>
<trans-unit id="backend.send_test">
<source>Send Test Email</source>
<source>Send Preview Mail</source>
</trans-unit>
<trans-unit id="backend.subject">
<source>Subject:</source>
......@@ -65,4 +65,4 @@
</trans-unit>
</body>
</file>
</xliff>
\ No newline at end of file
</xliff>
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