[TASK] Add mail html content partial and change template path handling
This commit is contained in:
parent
504386c717
commit
e11c0e8139
@ -40,15 +40,9 @@ class MailUtility
|
|||||||
$sender,
|
$sender,
|
||||||
$subject,
|
$subject,
|
||||||
$data,
|
$data,
|
||||||
$templateRootPaths = null,
|
|
||||||
$templateNameHtml = null,
|
$templateNameHtml = null,
|
||||||
$templateNameText = null
|
$templateNameText = null
|
||||||
) {
|
) {
|
||||||
if (!$templateRootPaths) {
|
|
||||||
$templatePaths = new TemplatePaths();
|
|
||||||
$templatePaths->fillDefaultsByPackageName('templates_aide');
|
|
||||||
$templateRootPaths = $templatePaths->getTemplateRootPaths();
|
|
||||||
}
|
|
||||||
if (!$templateNameHtml) {
|
if (!$templateNameHtml) {
|
||||||
$templateNameHtml = 'Mails/DefaultHtml';
|
$templateNameHtml = 'Mails/DefaultHtml';
|
||||||
}
|
}
|
||||||
@ -69,13 +63,11 @@ class MailUtility
|
|||||||
$htmlView->getTemplatePaths()->fillDefaultsByPackageName(
|
$htmlView->getTemplatePaths()->fillDefaultsByPackageName(
|
||||||
'templates_aide'
|
'templates_aide'
|
||||||
);
|
);
|
||||||
$htmlView->setTemplateRootPaths($templateRootPaths);
|
|
||||||
$htmlView->setTemplate($templateNameHtml);
|
$htmlView->setTemplate($templateNameHtml);
|
||||||
$textView = $objectManager->get(StandaloneView::class);
|
$textView = $objectManager->get(StandaloneView::class);
|
||||||
$textView->getTemplatePaths()->fillDefaultsByPackageName(
|
$textView->getTemplatePaths()->fillDefaultsByPackageName(
|
||||||
'templates_aide'
|
'templates_aide'
|
||||||
);
|
);
|
||||||
$textView->setTemplateRootPaths($templateRootPaths);
|
|
||||||
$textView->setTemplate($templateNameText);
|
$textView->setTemplate($templateNameText);
|
||||||
$mail = GeneralUtility::makeInstance(MailMessage::class);
|
$mail = GeneralUtility::makeInstance(MailMessage::class);
|
||||||
$mail->setFrom($sender);
|
$mail->setFrom($sender);
|
||||||
|
@ -1 +1,66 @@
|
|||||||
<p>included content<p>
|
<f:for each="{content}" as="row" key="rowKey" iteration="rowI" >
|
||||||
|
<v:condition.type.isArray value="{row.data}">
|
||||||
|
<f:then>
|
||||||
|
</f:then>
|
||||||
|
<f:else>
|
||||||
|
<f:if condition="{row.type} == 'headline' || {row.type} == 'text'">
|
||||||
|
<!--[if mso | IE]>
|
||||||
|
<table align="center" border="0" cellpadding="0" cellspacing="0" class="" style="width:640px;" width="640" >
|
||||||
|
<tr>
|
||||||
|
<td style="line-height:0px;font-size:0px;mso-line-height-rule:exactly;">
|
||||||
|
<![endif]-->
|
||||||
|
<div style="background:#ffffff;background-color:#ffffff;margin:0px auto;max-width:640px;">
|
||||||
|
<table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="background:#ffffff;background-color:#ffffff;width:100%;">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td style="direction:ltr;font-size:0px;padding:20px;text-align:center;">
|
||||||
|
<!--[if mso | IE]>
|
||||||
|
<table role="presentation" border="0" cellpadding="0" cellspacing="0">
|
||||||
|
<tr>
|
||||||
|
<td class="" style="vertical-align:top;width:600px;" >
|
||||||
|
<![endif]-->
|
||||||
|
<div class="mj-column-per-100 mj-outlook-group-fix" style="font-size:0px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:100%;">
|
||||||
|
<table border="0" cellpadding="0" cellspacing="0" role="presentation" width="100%">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td style="vertical-align:top;padding:0;">
|
||||||
|
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style width="100%">
|
||||||
|
<tr>
|
||||||
|
<td align="left" style="font-size:0px;padding:0;word-break:break-word;">
|
||||||
|
<div style="font-family:Arial, sans-serif;font-size:16px;line-height:1;text-align:left;color:#000000;">
|
||||||
|
<f:if condition="{row.type} == 'headline'">
|
||||||
|
<f:then>
|
||||||
|
<h2>{row.data -> f:format.nl2br() -> f:format.raw()}</h2>
|
||||||
|
</f:then>
|
||||||
|
<f:else>
|
||||||
|
<p>{row.data -> f:format.nl2br() -> f:format.raw()}</p>
|
||||||
|
</f:else>
|
||||||
|
</f:if>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<!--[if mso | IE]>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<![endif]-->
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<!--[if mso | IE]>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<![endif]-->
|
||||||
|
</f:if>
|
||||||
|
</f:else>
|
||||||
|
</v:condition.type.isArray>
|
||||||
|
</f:for>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user