[TASK] new changes Mail
This commit is contained in:
parent
0e15cad446
commit
9ba671cfd0
@ -79,10 +79,6 @@ class MailUtility
|
||||
$type = 'tableLayout';
|
||||
$textPart = substr($textPart, 3);
|
||||
}
|
||||
if (substr($textPart, 0, 3) === '---') {
|
||||
$type = 'divider';
|
||||
$textPart = substr($textPart, 3);
|
||||
}
|
||||
if (substr($textPart, 0, 9) === '%subject ') {
|
||||
$type = 'subject';
|
||||
$textPart = substr($textPart, 9);
|
||||
@ -238,7 +234,6 @@ class MailUtility
|
||||
case 'buttonleft':
|
||||
case 'buttoncenter':
|
||||
case 'buttonright':
|
||||
case 'divider':
|
||||
case 'hr':
|
||||
$row['data'] = str_replace(
|
||||
"\\\n",
|
||||
@ -315,10 +310,77 @@ class MailUtility
|
||||
$bodydataText[] = $textRow;
|
||||
$bodydataHtml[] = $htmlRow;
|
||||
break;
|
||||
case 'contentBlockHtml':
|
||||
$htmlRow = $row;
|
||||
$bodydataHtml[] = $htmlRow;
|
||||
break;
|
||||
//case 'button':
|
||||
// $row['data'] = str_replace(
|
||||
// "\\\n",
|
||||
// '',
|
||||
// $row['data']
|
||||
// );
|
||||
// $htmlRow = $row;
|
||||
// $htmlRow['data'] = preg_replace_callback(
|
||||
// '/\[.*\]/mU',
|
||||
// function($matches) {
|
||||
// foreach ($matches as $match) {
|
||||
// $test = preg_replace_callback(
|
||||
// '/\[(\S*)\s(.*)\]/mU',
|
||||
// function($matchesInner) {
|
||||
//
|
||||
// return '<a href="'
|
||||
// . $matchesInner[1]
|
||||
// . '">'
|
||||
// . $matchesInner[2]
|
||||
// . '</a>';
|
||||
// },
|
||||
// $match
|
||||
// );
|
||||
// \TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump(
|
||||
// $test, null, 3, true, false
|
||||
// );
|
||||
// return $test;
|
||||
// }
|
||||
// },
|
||||
// $htmlRow['data']
|
||||
// );
|
||||
// \TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump(
|
||||
// $htmlRow['data'], null, 3, true, false
|
||||
// );
|
||||
// $htmlRow['data'] = preg_replace_callback(
|
||||
// '/\*.*\*/mU',
|
||||
// function($matches) {
|
||||
// foreach ($matches as $match) {
|
||||
// return '<b>'
|
||||
// . substr($match, 1, -1)
|
||||
// . '</b>';
|
||||
// }
|
||||
// },
|
||||
// $htmlRow['data']
|
||||
// );
|
||||
// $textRow = $row;
|
||||
// $textRow['data'] = preg_replace_callback(
|
||||
// '/\[.*\]/mU',
|
||||
// function($matches) {
|
||||
// foreach ($matches as $match) {
|
||||
// return preg_replace_callback(
|
||||
// '/\[(\S*)\s(.*)\]/mU',
|
||||
// function($matchesInner) {
|
||||
// if (
|
||||
// $matchesInner[2] == $matchesInner[1]
|
||||
// ) {
|
||||
// return $matchesInner[1];
|
||||
// }
|
||||
// return $matchesInner[2]
|
||||
// . ': '
|
||||
// . $matchesInner[1];
|
||||
// },
|
||||
// $match
|
||||
// );
|
||||
// }
|
||||
// },
|
||||
// $textRow['data']
|
||||
// );
|
||||
// $bodydataText[] = $textRow;
|
||||
// $bodydataHtml[] = $htmlRow;
|
||||
// break;
|
||||
case 'attachment':
|
||||
$mail->attach(new \Swift_Attachment(
|
||||
$row['data'][0],
|
||||
@ -342,6 +404,9 @@ class MailUtility
|
||||
}
|
||||
$textView->assign('content', $bodydataText);
|
||||
$htmlView->assign('content', $bodydataHtml);
|
||||
//\TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump(
|
||||
// $bodydataHtml, null, 8, true, false
|
||||
//);
|
||||
$domain = $settings['mailDomain'];
|
||||
if ($assetDomain) {
|
||||
$domain = $assetDomain;
|
||||
|
@ -15,7 +15,7 @@
|
||||
</f:if>
|
||||
<f:if condition="{buttonBackgroundcolor}">
|
||||
<f:else>
|
||||
<f:variable name="buttonBackgroundcolor" value="#8ABF6F" />
|
||||
<f:variable name="buttonBackgroundcolor" value="#007D5A" />
|
||||
</f:else>
|
||||
</f:if>
|
||||
<f:variable name="widthPadded" value="{width - padding - padding}" />
|
||||
@ -24,16 +24,12 @@
|
||||
<f:for each="{content}" as="row" key="rowKey" iteration="rowI" >
|
||||
<v:condition.type.isArray value="{row.data}">
|
||||
<f:else>
|
||||
<f:if condition="{row.type} == 'contentBlockHtml'">
|
||||
{row.data -> f:format.raw()}
|
||||
</f:if>
|
||||
<f:if condition="{v:condition.string.contains(haystack: '{row.type}', needle: 'headline', then: '1')}
|
||||
|| {row.type} == 'text'
|
||||
|| {row.type} == 'button'
|
||||
|| {row.type} == 'buttonleft'
|
||||
|| {row.type} == 'buttoncenter'
|
||||
|| {row.type} == 'buttonright'
|
||||
|| {row.type} == 'divider'
|
||||
|| {row.type} == 'hr'
|
||||
">
|
||||
<!--[if mso | IE]>
|
||||
@ -55,14 +51,6 @@
|
||||
<table border="0" cellpadding="0" cellspacing="0" role="presentation" width="100%">
|
||||
<tbody>
|
||||
<tr>
|
||||
<f:switch expression="{row.type}">
|
||||
<f:case value="divider">
|
||||
<f:variable name='paddingTd' value='20px 0' />
|
||||
</f:case>
|
||||
<f:defaultCase>
|
||||
<f:variable name='paddingTd' value='0' />
|
||||
</f:defaultCase>
|
||||
</f:switch>
|
||||
<td style="vertical-align:top;padding:0;">
|
||||
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style width="100%">
|
||||
<tr>
|
||||
@ -77,11 +65,11 @@
|
||||
<f:variable name='align' value='left' />
|
||||
</f:defaultCase>
|
||||
</f:switch>
|
||||
<td align="{align}" style="font-size:0px;padding:{paddingTd};word-break:break-word;">
|
||||
<td align="{align}" style="font-size:0px;padding:0;word-break:break-word;">
|
||||
<div style="font-family:Arial, sans-serif;font-size:16px;line-height:1.4;text-align:{align};color:#000000;">
|
||||
<f:switch expression="{row.type}">
|
||||
<f:case value="headline">
|
||||
<h1>{row.data -> f:format.nl2br() -> f:format.raw()}</h1>
|
||||
<h1 style="margin-bottom: 20px;margin-top: 40px;font-size: 24px;line-height: 30px;">{row.data -> f:format.nl2br() -> f:format.raw()}</h1>
|
||||
</f:case>
|
||||
<f:case value="headline2">
|
||||
<h2>{row.data -> f:format.nl2br() -> f:format.raw()}</h2>
|
||||
@ -103,7 +91,7 @@
|
||||
<span style="display: inline-block;" class="buttonwrapper">
|
||||
<f:variable name="rowData">{row.data -> v:format.json.decode()}</f:variable>
|
||||
<a style="display: inline-block; color: {buttonColor}" target="_blank" href="{rowData.0}">
|
||||
<span style="display: inline-block; padding: 10px 15px; border-radius: 3px; background-color: {buttonBackgroundcolor};">
|
||||
<span style="display: inline-block; padding: 9px 24px; border-radius: 20px; background-color: {buttonBackgroundcolor};font-weight:bold;font-size:16px;line-height:1.5">
|
||||
{rowData.1}
|
||||
</span>
|
||||
</a>
|
||||
@ -115,39 +103,11 @@
|
||||
</span>
|
||||
</f:case>
|
||||
<f:case value="hr">
|
||||
<p style="border-top:solid 1px #bababa;font-size:1px;margin:13px auto;width:100%;">
|
||||
<p style="border-top:solid 2px #025093;margin:10px auto;width:100%;">
|
||||
</p>
|
||||
<!--[if mso | IE]>
|
||||
|
||||
<table
|
||||
align="center"
|
||||
border="0"
|
||||
cellpadding="0"
|
||||
cellspacing="0"
|
||||
style="border-top:solid 1px #bababa;font-size:1px;margin:13px auto;width:100%;"
|
||||
role="presentation"
|
||||
width="550px"
|
||||
>
|
||||
<tr>
|
||||
<td style="height:0;line-height:0;">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<![endif]-->
|
||||
</f:case>
|
||||
<f:case value="divider">
|
||||
<p style="border-top:solid 2px #025093;font-size:1px;margin:0px auto;width:100%;">
|
||||
</p>
|
||||
<!--[if mso | IE]>
|
||||
<table align="center" border="0" cellpadding="0" cellspacing="0" style="border-top:solid 2px #025093;font-size:1px;margin:0px auto;width:550px;" role="presentation" width="550px" >
|
||||
<tr><td style="height:0;line-height:0;"> </td></tr>
|
||||
</table>
|
||||
<![endif]-->
|
||||
</f:case>
|
||||
<f:defaultCase>
|
||||
<p>{row.data -> f:format.nl2br() -> f:format.raw()}</p>
|
||||
<p style="margin: 20px 0;">{row.data -> f:format.nl2br() -> f:format.raw()}</p>
|
||||
</f:defaultCase>
|
||||
</f:switch>
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user