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

[TASK] Fixing cgl issues

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