From 2e67ad7d36131860e235fa78b415a2b5f9c315d7 Mon Sep 17 00:00:00 2001
From: Stefan Galinski <stefan@sgalinski.de>
Date: Sun, 14 May 2017 20:58:44 +0200
Subject: [PATCH] [BUGFIX] Fix missing from name if mails are sent via the
 queue

---
 Classes/Command/SendMailCommandController.php | 2 +-
 Classes/Service/MailTemplateService.php       | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/Classes/Command/SendMailCommandController.php b/Classes/Command/SendMailCommandController.php
index b158db3a..2df3ada8 100644
--- a/Classes/Command/SendMailCommandController.php
+++ b/Classes/Command/SendMailCommandController.php
@@ -71,7 +71,7 @@ class SendMailCommandController extends CommandController {
 			}
 
 			$mailMessage = $this->objectManager->get(MailMessage::class);
-			$mailMessage->setFrom($fromAddress);
+			$mailMessage->setFrom($fromAddress, $mailToSend->getFromName());
 			$mailMessage->setTo($toAddress);
 			$mailMessage->setSubject($mailSubject);
 			if (count($ccAddresses)) {
diff --git a/Classes/Service/MailTemplateService.php b/Classes/Service/MailTemplateService.php
index 654a3e74..0c716e4f 100644
--- a/Classes/Service/MailTemplateService.php
+++ b/Classes/Service/MailTemplateService.php
@@ -181,7 +181,6 @@ class MailTemplateService {
 			}
 		}
 
-		$this->mailMessage->setFrom($this->fromAddress);
 		if (count($this->bccAddresses) > 0) {
 			$this->mailMessage->setBcc($this->bccAddresses);
 		}
-- 
GitLab