[TASK] Add mail html content partial and change template path handling

This commit is contained in:
Philipp Dieter
2020-11-22 19:37:47 +01:00
parent 504386c717
commit e11c0e8139
2 changed files with 66 additions and 9 deletions

View File

@@ -40,15 +40,9 @@ class MailUtility
$sender,
$subject,
$data,
$templateRootPaths = null,
$templateNameHtml = null,
$templateNameText = null
) {
if (!$templateRootPaths) {
$templatePaths = new TemplatePaths();
$templatePaths->fillDefaultsByPackageName('templates_aide');
$templateRootPaths = $templatePaths->getTemplateRootPaths();
}
if (!$templateNameHtml) {
$templateNameHtml = 'Mails/DefaultHtml';
}
@@ -69,13 +63,11 @@ class MailUtility
$htmlView->getTemplatePaths()->fillDefaultsByPackageName(
'templates_aide'
);
$htmlView->setTemplateRootPaths($templateRootPaths);
$htmlView->setTemplate($templateNameHtml);
$textView = $objectManager->get(StandaloneView::class);
$textView->getTemplatePaths()->fillDefaultsByPackageName(
'templates_aide'
);
$textView->setTemplateRootPaths($templateRootPaths);
$textView->setTemplate($templateNameText);
$mail = GeneralUtility::makeInstance(MailMessage::class);
$mail->setFrom($sender);