[MERGE] Branch 'master' of github_atticmedia:cjel/typo3-templates_aide

This commit is contained in:
Philipp Dieter 2021-04-28 00:03:45 +02:00
commit 75be493b60

View File

@ -41,7 +41,8 @@ class MailUtility
$subject, $subject,
$data, $data,
$templateNameHtml = null, $templateNameHtml = null,
$templateNameText = null $templateNameText = null,
$templatePaths = null
) { ) {
if (!$templateNameHtml) { if (!$templateNameHtml) {
$templateNameHtml = 'Mails/DefaultHtml'; $templateNameHtml = 'Mails/DefaultHtml';
@ -60,14 +61,23 @@ class MailUtility
(array)$typoScript['module.']['tx_templatesaide.']['settings.']; (array)$typoScript['module.']['tx_templatesaide.']['settings.'];
$settings = GeneralUtility::removeDotsFromTS($settings); $settings = GeneralUtility::removeDotsFromTS($settings);
$htmlView = $objectManager->get(StandaloneView::class); $htmlView = $objectManager->get(StandaloneView::class);
$htmlView->getTemplatePaths()->fillDefaultsByPackageName(
'templates_aide'
);
$htmlView->setTemplate($templateNameHtml); $htmlView->setTemplate($templateNameHtml);
$textView = $objectManager->get(StandaloneView::class); $textView = $objectManager->get(StandaloneView::class);
$textView->getTemplatePaths()->fillDefaultsByPackageName( if ($templatePaths) {
'templates_aide' $htmlView->setTemplateRootPaths(
); $templatePaths->getTemplateRootPaths()
);
$textView->setTemplateRootPaths(
$templatePaths->getTemplateRootPaths()
);
} else {
$htmlView->getTemplatePaths()->fillDefaultsByPackageName(
'templates_aide'
);
$textView->getTemplatePaths()->fillDefaultsByPackageName(
'templates_aide'
);
}
$textView->setTemplate($templateNameText); $textView->setTemplate($templateNameText);
$mail = GeneralUtility::makeInstance(MailMessage::class); $mail = GeneralUtility::makeInstance(MailMessage::class);
$mail->setFrom($sender); $mail->setFrom($sender);