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

[TASK] Fixing cgl issues

parent 1b115f68
...@@ -107,13 +107,6 @@ class MailTemplateService { ...@@ -107,13 +107,6 @@ class MailTemplateService {
*/ */
private $markers = []; private $markers = [];
/**
* holds the TypoScript configuration for sg_mail
*
* @var array $tsSettings
*/
private $tsSettings;
/** /**
* @var array $bccAddresses * @var array $bccAddresses
*/ */
...@@ -168,7 +161,7 @@ class MailTemplateService { ...@@ -168,7 +161,7 @@ class MailTemplateService {
$this->mailMessage = $this->objectManager->get(MailMessage::class); $this->mailMessage = $this->objectManager->get(MailMessage::class);
/** @var TypoScriptSettingsService $typoScriptSettingsService */ /** @var TypoScriptSettingsService $typoScriptSettingsService */
$typoScriptSettingsService = $this->objectManager->get(TypoScriptSettingsService::class); $typoScriptSettingsService = $this->objectManager->get(TypoScriptSettingsService::class);
$this->tsSettings = $typoScriptSettingsService->getSettings(0, 'tx_sgmail'); $tsSettings = $typoScriptSettingsService->getSettings(0, 'tx_sgmail');
/** @var TemplateRepository templateRepository */ /** @var TemplateRepository templateRepository */
$this->templateRepository = $this->objectManager->get(TemplateRepository::class); $this->templateRepository = $this->objectManager->get(TemplateRepository::class);
/** @var PersistenceManager persistenceManager */ /** @var PersistenceManager persistenceManager */
...@@ -178,19 +171,19 @@ class MailTemplateService { ...@@ -178,19 +171,19 @@ class MailTemplateService {
if (!filter_var($GLOBALS['TYPO3_CONF_VARS']['MAIL']['defaultMailFromAddress'], FILTER_VALIDATE_EMAIL)) { if (!filter_var($GLOBALS['TYPO3_CONF_VARS']['MAIL']['defaultMailFromAddress'], FILTER_VALIDATE_EMAIL)) {
$this->fromAddress = $GLOBALS['TYPO3_CONF_VARS']['MAIL']['defaultMailFromAddress']; $this->fromAddress = $GLOBALS['TYPO3_CONF_VARS']['MAIL']['defaultMailFromAddress'];
} else { } else {
$this->fromAddress = $this->tsSettings['mail']['default']['from']; $this->fromAddress = $tsSettings['mail']['default']['from'];
if (!filter_var($this->tsSettings['mail']['default']['from'], FILTER_VALIDATE_EMAIL)) { if (!filter_var($tsSettings['mail']['default']['from'], FILTER_VALIDATE_EMAIL)) {
$this->fromAddress = 'noreply@example.org'; $this->fromAddress = 'noreply@example.org';
} else { } else {
$this->fromAddress = $this->tsSettings['mail']['default']['from']; $this->fromAddress = $tsSettings['mail']['default']['from'];
} }
} }
$this->mailMessage->setFrom($this->fromAddress); $this->mailMessage->setFrom($this->fromAddress);
$this->bccAddresses = GeneralUtility::trimExplode(',', $this->tsSettings['mail']['default']['bcc']); $this->bccAddresses = GeneralUtility::trimExplode(',', $tsSettings['mail']['default']['bcc']);
$this->ccAddresses = GeneralUtility::trimExplode(',', $this->tsSettings['mail']['default']['cc']); $this->ccAddresses = GeneralUtility::trimExplode(',', $tsSettings['mail']['default']['cc']);
foreach ($this->bccAddresses as $index => $email) { foreach ($this->bccAddresses as $index => $email) {
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) { if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
...@@ -231,7 +224,7 @@ class MailTemplateService { ...@@ -231,7 +224,7 @@ class MailTemplateService {
public static function registerTemplate( public static function registerTemplate(
$extension, $templateName, $templatePath, $description, array $markers, $subject, $usage = '' $extension, $templateName, $templatePath, $description, array $markers, $subject, $usage = ''
) { ) {
MailTemplateService::$registerArray[$extension][$templateName] = [ self::$registerArray[$extension][$templateName] = [
'templatePath' => $templatePath, 'templatePath' => $templatePath,
'description' => $description, 'description' => $description,
'marker' => $markers, 'marker' => $markers,
...@@ -336,6 +329,7 @@ class MailTemplateService { ...@@ -336,6 +329,7 @@ class MailTemplateService {
$this->loadTemplateValues($template); $this->loadTemplateValues($template);
} }
$defaultTemplateContent = NULL;
// If there is no template for this language, use the default template // If there is no template for this language, use the default template
if ($template === NULL) { if ($template === NULL) {
...@@ -683,7 +677,6 @@ class MailTemplateService { ...@@ -683,7 +677,6 @@ class MailTemplateService {
$this->setBccAddresses($template->getBcc()); $this->setBccAddresses($template->getBcc());
$this->setReplyToAddress($template->getReplyTo()); $this->setReplyToAddress($template->getReplyTo());
$this->setFromName($fromName); $this->setFromName($fromName);
$this->setReplyToAddress($template->getReplyTo()); $this->setReplyToAddress($template->getReplyTo());
} }
......
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