[TASK] Mail: Add hr, right aligned table, debugging output

This commit is contained in:
Philipp Dieter 2022-12-09 01:42:02 +01:00
parent e126e674c7
commit 329de2771e
2 changed files with 40 additions and 3 deletions

View File

@ -223,6 +223,7 @@ class MailUtility
switch($row['type']) { switch($row['type']) {
case 'text': case 'text':
case 'table': case 'table':
case 'tablelr':
case 'tableLayout': case 'tableLayout':
case 'list': case 'list':
case 'textbold': case 'textbold':
@ -233,6 +234,7 @@ class MailUtility
case 'buttonleft': case 'buttonleft':
case 'buttoncenter': case 'buttoncenter':
case 'buttonright': case 'buttonright':
case 'hr':
$row['data'] = str_replace( $row['data'] = str_replace(
"\\\n", "\\\n",
'', '',
@ -457,4 +459,23 @@ class MailUtility
} }
} }
} }
/**
* Debug print
*/
public static function printMaildata($maildata)
{
foreach ($maildata as $row) {
if (!is_array($row['data'])) {
print($row['data']);
} else {
print($row['data'][0]);
print(PHP_EOL);
print($row['data'][1]);
}
print(PHP_EOL);
}
print(PHP_EOL);
}
} }

View File

@ -30,6 +30,7 @@
|| {row.type} == 'buttonleft' || {row.type} == 'buttonleft'
|| {row.type} == 'buttoncenter' || {row.type} == 'buttoncenter'
|| {row.type} == 'buttonright' || {row.type} == 'buttonright'
|| {row.type} == 'hr'
"> ">
<!--[if mso | IE]> <!--[if mso | IE]>
<table align="center" border="0" cellpadding="0" cellspacing="0" class="" style="width:{width}px;" width="{width}" > <table align="center" border="0" cellpadding="0" cellspacing="0" class="" style="width:{width}px;" width="{width}" >
@ -101,6 +102,10 @@
{row.data -> f:format.nl2br() -> f:format.raw()} {row.data -> f:format.nl2br() -> f:format.raw()}
</span> </span>
</f:case> </f:case>
<f:case value="hr">
<p style="border-top:solid 1px #bababa;font-size:1px;margin:13px auto;width:100%;">
</p>
</f:case>
<f:defaultCase> <f:defaultCase>
<p>{row.data -> f:format.nl2br() -> f:format.raw()}</p> <p>{row.data -> f:format.nl2br() -> f:format.raw()}</p>
</f:defaultCase> </f:defaultCase>
@ -137,6 +142,9 @@
<f:case value="table"> <f:case value="table">
<f:variable name="type" value="table" /> <f:variable name="type" value="table" />
</f:case> </f:case>
<f:case value="tablelr">
<f:variable name="type" value="table" />
</f:case>
<f:case value="tableLayout"> <f:case value="tableLayout">
<f:variable name="type" value="table" /> <f:variable name="type" value="table" />
</f:case> </f:case>
@ -178,11 +186,19 @@
</td> </td>
<td class="" style="vertical-align:top;width:{widthTableColumn}px;"> <td class="" style="vertical-align:top;width:{widthTableColumn}px;">
<![endif]--> <![endif]-->
<div class="mj-column-per-50 outlook-group-fix" style="font-size:13px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:100%;"> <f:switch expression="{row.type}">
<f:case value="tablelr">
<f:variable name="align" value="right" />
</f:case>
<f:defaultCase>
<f:variable name="align" value="left" />
</f:defaultCase>
</f:switch>
<div class="mj-column-per-50 outlook-group-fix" style="font-size:13px;text-align:{align};direction:ltr;display:inline-block;vertical-align:top;width:100%;">
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="vertical-align:top;" width="100%"> <table border="0" cellpadding="0" cellspacing="0" role="presentation" style="vertical-align:top;" width="100%">
<tr> <tr>
<td align="left" style="font-size:0px;padding:0px 4px;word-break:break-word;"> <td align="{align}" style="font-size:0px;padding:0px 4px;word-break:break-word;">
<div style="font-family:Arial, sans-serif;font-size:16px;line-height:1.4;text-align:left;color:#000000;"> <div style="font-family:Arial, sans-serif;font-size:16px;line-height:1.4;text-align:{align};color:#000000;">
<div>{row.data.1 -> f:format.nl2br() -> f:format.raw()}</div> <div>{row.data.1 -> f:format.nl2br() -> f:format.raw()}</div>
</div> </div>
</td> </td>