Commit 8cd2ba9f authored by Kevin Ditscheid's avatar Kevin Ditscheid
Browse files

[BUGFIX] Fix the preview mail sending

parent 49b2dee7
......@@ -651,14 +651,18 @@ class MailTemplateService {
$emailBody = nl2br($emailBody);
$emailBody = preg_replace('/(<br[\s]?[\/]?>[\s]*){3,}/', '<br><br>', $emailBody);
if (!$isPreview) {
$mail = $this->addMailToMailQueue(
$this->extensionKey, $this->templateName, $subject, $emailBody, $this->priority,
0, 0, $this->language, $siteRootId
);
if ($this->ignoreMailQueue) {
$success = $this->sendMailFromQueue($mail->getUid());
}
$mail = $this->addMailToMailQueue(
$this->extensionKey, $this->templateName, $subject, $emailBody, $this->priority,
0, 0, $this->language, $siteRootId
);
if ($this->ignoreMailQueue) {
$success = $this->sendMailFromQueue($mail->getUid());
}
if ($isPreview) {
$mailRepository = $this->objectManager->get(MailRepository::class);
$mailRepository->remove($mail);
$this->persistenceManager->persistAll();
}
return $success;
......
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