Commit 05531656 authored by Torsten Oppermann's avatar Torsten Oppermann
Browse files

[TASK] Add allmarker as default template content, fixed a bug where the...

[TASK] Add allmarker as default template content, fixed a bug where the template name could not be resolved
parent 387c9b3f
......@@ -64,10 +64,16 @@ class FormsFinisher extends AbstractFinisher {
$markers[$identifier] = $value;
}
}
$templateName = $this->parseOption('template');
if ($this->parseOption('template') === '') {
$templateName = $formDefinition->getIdentifier();
}
$objectManager = GeneralUtility::makeInstance(ObjectManager::class);
/** @var \SGalinski\SgMail\Service\MailTemplateService $mailTemplateService */
$mailTemplateService = $objectManager->get(
MailTemplateService::class, $this->parseOption('template'), $this->parseOption('extension'), $markers
MailTemplateService::class, $templateName, $this->parseOption('extension'), $markers
);
$mailTemplateService->setIgnoreMailQueue(FALSE);
......
......@@ -297,7 +297,12 @@ class MailTemplateService {
if (file_exists($defaultTemplateFile)) {
$defaultTemplateContent = file_get_contents($defaultTemplateFile);
} else {
return FALSE;
if (isset(self::getRegisterArray()[$this->extensionKey][$this->templateName]['templateContent'])) {
$defaultTemplateContent = self::getRegisterArray(
)[$this->extensionKey][$this->templateName]['templateContent'];
} else {
return FALSE;
}
}
} elseif (filter_var($template->getToAddress(), FILTER_VALIDATE_EMAIL)) {
$this->setToAddresses(trim($template->getToAddress()));
......@@ -865,7 +870,8 @@ class MailTemplateService {
'marker' => $marker,
'extension' => $extensionKey,
'templateName' => $templateKey,
'subject' => $subject
'subject' => $subject,
'templateContent' => $configArray['templateContent']
];
return $registerArray;
......
......@@ -169,7 +169,8 @@ class FormEditorController extends \TYPO3\CMS\Form\Controller\FormEditorControll
'template_key' => $templateKey,
'description' => $templateKey,
'subject' => $templateKey,
'markers' => []
'markers' => [],
'templateContent' => '{all_marker}'
];
// add the markers for this template
......
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