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

[TASK] Adding template name & extension key when saving into queue

parent aed44a7e
......@@ -361,11 +361,11 @@ class MailTemplateService {
$emailBody = preg_replace('/(<br[\s]?[\/]?>[\s]*){3,}/', '<br /><br />', $emailBody);
if ($this->ignoreMailQueue) {
$this->addMailToMailQueue($subject, $emailBody, $this->priority, TRUE);
$this->addMailToMailQueue($this->extensionKey, $this->templateName, $subject, $emailBody, $this->priority, TRUE);
$this->mailMessage->setBody($emailBody, 'text/html');
$this->mailMessage->send();
} else {
$this->addMailToMailQueue($subject, $emailBody, $this->priority);
$this->addMailToMailQueue($this->extensionKey, $this->templateName, $subject, $emailBody, $this->priority);
}
return TRUE;
......@@ -374,13 +374,17 @@ class MailTemplateService {
/**
* Adds a new mail to the mail queue.
*
* @param string $extensionKey
* @param string $templateName
* @param string $subject
* @param string $emailBody
* @param int $priority
* @param bool $sent
*/
private function addMailToMailQueue($subject, $emailBody, $priority, $sent = FALSE) {
private function addMailToMailQueue($extensionKey, $templateName, $subject, $emailBody, $priority, $sent = FALSE) {
$mail = $this->objectManager->get(Mail::class);
$mail->setExtensionKey($extensionKey);
$mail->setTemplateName($templateName);
$mail->setFromAddress($this->fromAddress);
$mail->setToAddress($this->toAddresses);
$mail->setMailSubject($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