diff --git a/Classes/Controller/QueueController.php b/Classes/Controller/QueueController.php index 9b1178d491cdbfd3c10091c3706ead290e13a56e..893b354f0e2ae0c3521b7e7922dae69a219a3fb9 100644 --- a/Classes/Controller/QueueController.php +++ b/Classes/Controller/QueueController.php @@ -182,6 +182,18 @@ class QueueController extends ActionController { $this->redirect('index', NULL, NULL, $this->request->getArguments()); } + /** + * Preview for a mail + * + * @param int $uid + */ + public function previewAction($uid): void { + $mailService = new MailTemplateService(); + $mailToPreview = $mailService->getMailObjectByUid($uid); + + $this->view->assign('mail', $mailToPreview); + } + /** * Download the queue data as a csv file, respecting the filter settings * @@ -225,7 +237,8 @@ class QueueController extends ActionController { // save the Template filter to the session if (!isset($_SESSION[$this->session->getSessionKey()]['filterTemplate']) - || (isset($_POST['filterTemplate']) && $this->session->getDataByKey('filterTemplate') !== $_POST['filterTemplate'])) { + || (isset($_POST['filterTemplate']) + && $this->session->getDataByKey('filterTemplate') !== $_POST['filterTemplate'])) { $this->session->setDataByKey('filterTemplate', $_POST['filterTemplate']); } diff --git a/Classes/Service/MailTemplateService.php b/Classes/Service/MailTemplateService.php index 83676e37fb1f933936cd83e47a76eab3811be098..4ff49106aacc60da944710ac379421ab256902eb 100644 --- a/Classes/Service/MailTemplateService.php +++ b/Classes/Service/MailTemplateService.php @@ -1263,7 +1263,7 @@ class MailTemplateService { * @param int $uid * @return bool|object */ - private function getMailObjectByUid($uid) { + public function getMailObjectByUid($uid) { if (version_compare(VersionNumberUtility::getCurrentTypo3Version(), '10.4.0', '<')) { /** @var MailRepository $mailRepository */ $mailRepository = $this->objectManager->get(MailRepository::class); diff --git a/Resources/Private/Language/de.locallang.xlf b/Resources/Private/Language/de.locallang.xlf index 98b68fbbe1efc6aba403768f1ce3c0012ce549a2..0bdcf046cf34bee82dc787995eddab63063673e4 100644 --- a/Resources/Private/Language/de.locallang.xlf +++ b/Resources/Private/Language/de.locallang.xlf @@ -589,6 +589,30 @@ Die Templates declined und approved der Extension sg_comments sind für alle Dom + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Resources/Private/Language/locallang.xlf b/Resources/Private/Language/locallang.xlf index 779454c18c6016855a4c2b68cb4d4a50d4643c33..5634e05a510907168fb333a0d85c9265cf0fbec4 100644 --- a/Resources/Private/Language/locallang.xlf +++ b/Resources/Private/Language/locallang.xlf @@ -441,6 +441,24 @@ The templates declined and approved of the sg_comments extension are blacklisted + + + + + + + + + + + + + + + + + + diff --git a/Resources/Private/Layouts/Preview.html b/Resources/Private/Layouts/Preview.html new file mode 100644 index 0000000000000000000000000000000000000000..380ad79e7b4f847028c637b6d3c690ec01aac724 --- /dev/null +++ b/Resources/Private/Layouts/Preview.html @@ -0,0 +1,7 @@ +{namespace sgm=SGalinski\SgMail\ViewHelpers} + + + + + + diff --git a/Resources/Private/Templates/Queue/Index.html b/Resources/Private/Templates/Queue/Index.html index 78f27d7829e45e8b2b79068dac468b204e21924c..c75f7eeb34a2560755db9897f0b76cb27419845f 100644 --- a/Resources/Private/Templates/Queue/Index.html +++ b/Resources/Private/Templates/Queue/Index.html @@ -1,91 +1,113 @@ {namespace sgm=SGalinski\SgMail\ViewHelpers} - + - + - +
- + - - - - - - - - + + + + + + + + - - - - - + + + - - - + + + - + + + + + + +

-
: -
-

-
+ +
+ +
+ + : + +
+ +
+ +
+ +
- - - {mail.from_address} -
- {mail.to_address} -
- {mail.extension_key}: {mail.template_name} -
- - - {mail.mail_subject} - - -   - - + +
+ + + {mail.from_address} +
+ {mail.to_address} +
+ {mail.extension_key}: {mail.template_name} +
+ + + {mail.mail_subject} + + +   + + -
- {mail.crdate} -
- - - {mail.last_sending_time} - - - - - -
- - - - - - - - - + + {mail.crdate} +
+ + + {mail.last_sending_time} + + + + + +
+ + + + + + + + + + + - + - - - - -
@@ -93,27 +115,27 @@
- + - +
- - - - - + + + + +
- - - {page._thePathFull} - -
+ + + {page._thePathFull} + +
diff --git a/Resources/Private/Templates/Queue/Preview.html b/Resources/Private/Templates/Queue/Preview.html new file mode 100644 index 0000000000000000000000000000000000000000..ee57f58fde17f7d903aa2afe96641b35b1e57bec --- /dev/null +++ b/Resources/Private/Templates/Queue/Preview.html @@ -0,0 +1,74 @@ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + {mail.sendingTime} + +
+ + + {mail.fromName} + <{mail.fromAddress}> +
+ + + + {mail.mailSubject} + +
+ + + {mail.toAddress} +
+ + + {mail.ccAddresses} +
+ + + {mail.bccAddresses} +
+
+ +
+ +
+
diff --git a/Resources/Public/StyleSheets/preview.css b/Resources/Public/StyleSheets/preview.css new file mode 100644 index 0000000000000000000000000000000000000000..0ff0c1f1e077c78c6842a6a9cef27073e727a86c --- /dev/null +++ b/Resources/Public/StyleSheets/preview.css @@ -0,0 +1,41 @@ +* { + font-family: Sans-Serif; +} + +body { + margin: 0; +} + +.mail-header { + border-bottom: 1px solid #666; + padding: 5px 7px; +} + +.mail-header tbody td { + width: 100%; + font-size: 15px; +} + +.mail-header tbody th { + white-space: nowrap; + text-align: right; + color: #666; + font-weight: normal; + font-size: 15px; +} + +.mail-header table td, +.mail-header table th { + padding: 2px 7px; +} + +.mail-body { + padding: 10px; +} + +.mail-body-iframe{ + border: none; + width: 100%; + max-width: 1280px; + height:100vh; +} diff --git a/ext_tables.php b/ext_tables.php index 2b892c35fa7be3437adfa0de3fe0d4091de37450..e1195c77f357bc301a5ff5dc0d4c754716393f7d 100644 --- a/ext_tables.php +++ b/ext_tables.php @@ -32,7 +32,7 @@ call_user_func( '', [ 'Mail' => 'index, sendTestMail, empty, reset', - 'Queue' => 'index, sendMail, export', + 'Queue' => 'index, sendMail, export, preview', 'Configuration' => 'index, create, edit, delete', 'Layout' => 'index', 'Newsletter' => 'index, sendTestMail, empty',