Commit ed0b31f5 authored by Stefan Galinski's avatar Stefan Galinski 🎮
Browse files

[BUGFIX] Fix some mail queue issues

parent 03adcf99
......@@ -244,11 +244,11 @@ class MailTemplateService {
$emailView->assignMultiple($this->markers);
$emailBody = $emailView->render();
if ($this->ignoreMailQueue) {
// insert <br /> tags, but replace every instance of three or more successive breaks with just two.
$emailBody = nl2br($emailBody);
$emailBody = preg_replace('/(<br[\s]?[\/]?>[\s]*){3,}/', '<br /><br />', $emailBody);
// insert <br /> tags, but replace every instance of three or more successive breaks with just two.
$emailBody = nl2br($emailBody);
$emailBody = preg_replace('/(<br[\s]?[\/]?>[\s]*){3,}/', '<br /><br />', $emailBody);
if ($this->ignoreMailQueue) {
$this->mailMessage->setBody($emailBody, 'text/html');
$this->mailMessage->send();
} else {
......@@ -263,18 +263,12 @@ class MailTemplateService {
*
* @param string $emailBody
* @param int $priority
* @param int $pid
*/
private function addMailToMailQueue($emailBody, $priority, $pid = 0) {
private function addMailToMailQueue($emailBody, $priority) {
/** @var ObjectManager $objectManager */
$objectManager = GeneralUtility::makeInstance(ObjectManager::class);
if ($pid <= 0 && isset($GLOBALS['TSFE'])) {
$pid = (int) $GLOBALS['TSFE']->id;
}
$mail = $objectManager->get(Mail::class);
$mail->setPid($pid);
$mail->setFromAddress($this->fromAddress);
$mail->setToAddress($this->toAddresses);
$mail->setMailSubject($this->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