[TASK] new changes Mail

This commit is contained in:
wadichaabene
2024-07-17 23:58:53 +01:00
parent 0e15cad446
commit 9ba671cfd0
2 changed files with 80 additions and 55 deletions

View File

@@ -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;