Commit 6b05d144 authored by Torsten Oppermann's avatar Torsten Oppermann
Browse files

[TASK] Using Default BCC and CC from config

parent 59ebb7fb
......@@ -120,6 +120,14 @@ class MailTemplateService {
$typoScriptSettingsService = $objectManager->get(TypoScriptSettingsService::class);
$this->tsSettings = $typoScriptSettingsService->getSettings(0, 'tx_sgmail');
$this->language = $this->tsSettings['templateDefaultLanguage'];
$this->fromAddress = $this->tsSettings['mail']['default']['from'];
$this->mailMessage->setFrom($this->fromAddress);
$this->bccAddresses = explode(',', $this->tsSettings['mail']['default']['bcc']);
$this->ccAddresses = explode(',', $this->tsSettings['mail']['default']['cc']);
$this->mailMessage->setBcc($this->bccAddresses);
$this->mailMessage->setBcc($this->ccAddresses);
}
/**
......@@ -239,8 +247,8 @@ class MailTemplateService {
* @return MailTemplateService
*/
public function setCcAddresses($ccAddresses) {
$this->ccAddresses = $ccAddresses;
$this->mailMessage->setCc($ccAddresses);
$this->ccAddresses[] = $ccAddresses;
$this->mailMessage->setCc($this->ccAddresses);
return $this;
}
......@@ -314,8 +322,8 @@ class MailTemplateService {
* @return MailTemplateService
*/
public function setBccAddresses(array $bccAddresses) {
$this->bccAddresses = $bccAddresses;
$this->mailMessage->setBcc($bccAddresses);
$this->bccAddresses[] = $bccAddresses;
$this->mailMessage->setBcc($this->bccAddresses);
return $this;
}
......
......@@ -9,6 +9,10 @@ module.tx_sgmail {
mail {
test.from = info@test.de
test.subject = This is just a Test E-Mail
default.from = noreply@ele.de
default.bcc = torsten@sgalinski.de, stefan@sgalinski.de
default.cc = torsten@sgalinski.de
}
templateDefaultLanguage = en
......
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