Commit 324fa8df authored by Torsten Oppermann's avatar Torsten Oppermann
Browse files

[TASK] Refactoring some namings

parent 721f6c0a
......@@ -77,8 +77,8 @@ class FormhandlerFinisherService extends AbstractFinisher {
$objectManager = GeneralUtility::makeInstance(ObjectManager::class);
/** @var \SGalinski\SgMail\Service\MailTemplateService $mailTemplateService */
$mailTemplateService = $objectManager->get(MailTemplateService::class);
$mailTemplateService->setTo($toAddress);
$mailTemplateService->setFrom($fromAddress);
$mailTemplateService->setToAddresses($toAddress);
$mailTemplateService->setFromAddresses($fromAddress);
$mailTemplateService->setSubject($subject);
$mailTemplateService->setTemplateName($this->settings['template_key']);
$mailTemplateService->setExtensionKey($this->settings['extension_key']);
......
......@@ -44,24 +44,24 @@ class MailTemplateService {
private static $registerArray = [];
/**
* @var array to
* @var array toAddresses
*/
private $to = [];
private $toAddresses = [];
/**
* @var string from
* @var string fromAddress
*/
private $from;
private $fromAddress;
/**
* @var string $cc
* @var array ccAddresses
*/
private $cc;
private $ccAddresses = [];
/**
* @var string replyTo
* @var string replyToAddress
*/
private $replyTo;
private $replyToAddress;
/**
* @var string language
......@@ -175,6 +175,8 @@ class MailTemplateService {
* Adds a new mail to the mail queue.
*
* @param string $emailBody
* @param int $priority
* @param int $pid
*/
private function addMailToMailQueue($emailBody, $priority = Mail::PRIORITY_LOWEST, $pid = 0) {
/** @var ObjectManager $objectManager */
......@@ -186,8 +188,8 @@ class MailTemplateService {
$mail = $objectManager->get(Mail::class);
$mail->setPid($pid);
$mail->setFromAddress($this->from);
$mail->setToAddress($this->to);
$mail->setFromAddress($this->fromAddress);
$mail->setToAddress($this->toAddresses);
$mail->setMailSubject($this->subject);
$mail->setMailBody($emailBody);
$mail->setPriority($priority);
......@@ -205,42 +207,42 @@ class MailTemplateService {
}
/**
* @param array | string $to
* @param array|string $toAddresses
* @return MailTemplateService
*/
public function setTo($to) {
$this->to = $to;
$this->mailMessage->setTo($to);
public function setToAddresses($toAddresses) {
$this->toAddresses = $toAddresses;
$this->mailMessage->setTo($toAddresses);
return $this;
}
/**
* @param array | string $from
* @param array|string $fromAddress
* @return MailTemplateService
*/
public function setFrom($from) {
$this->from = $from;
$this->mailMessage->setFrom($from);
public function setFromAddresses($fromAddress) {
$this->fromAddress = $fromAddress;
$this->mailMessage->setFrom($fromAddress);
return $this;
}
/**
* @param array | string $cc
* @param array|string $ccAddresses
* @return MailTemplateService
*/
public function setCc($cc) {
$this->cc = $cc;
$this->mailMessage->setCc($cc);
public function setCcAddresses($ccAddresses) {
$this->ccAddresses = $ccAddresses;
$this->mailMessage->setCc($ccAddresses);
return $this;
}
/**
* @param array | string $replyTo
* @param array|string $replyToAddress
* @return MailTemplateService
*/
public function setReplyTo($replyTo) {
$this->replyTo = $replyTo;
$this->mailMessage->setReplyTo($replyTo);
public function setReplyToAddress($replyToAddress) {
$this->$replyToAddress = $replyToAddress;
$this->mailMessage->setReplyTo($replyToAddress);
return $this;
}
......
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