From 62b8bcb43fe8b0bae9cf307765e60dfcfe4ccdda Mon Sep 17 00:00:00 2001 From: KreativeKrise Date: Tue, 9 Mar 2021 16:16:46 +0100 Subject: [PATCH] [FEATURE] Add section to email links #654 --- Classes/Controller/FormController.php | 4 ++-- .../Service/Mail/SendOptinConfirmationMailPreflight.php | 6 ++++-- Classes/Domain/Service/Mail/SendSenderMailPreflight.php | 6 ++++-- Resources/Private/Partials/Mail/DisclaimerLink.html | 2 +- Resources/Private/Templates/Mail/OptinMail.html | 3 ++- Resources/Private/Templates/Mail/SenderMail.html | 1 + 6 files changed, 14 insertions(+), 8 deletions(-) diff --git a/Classes/Controller/FormController.php b/Classes/Controller/FormController.php index 279e3cfa2..c8f7d6906 100644 --- a/Classes/Controller/FormController.php +++ b/Classes/Controller/FormController.php @@ -202,7 +202,7 @@ public function createAction(Mail $mail, string $hash = ''): void $this->settings, $this->conf ); - $mailPreflight->sendOptinConfirmationMail($mail); + $mailPreflight->sendOptinConfirmationMail($mail, $this->contentObject->data); $this->view->assign('optinActive', true); } if ($this->isPersistActive()) { @@ -238,7 +238,7 @@ protected function sendMailPreflight(Mail $mail, string $hash = ''): void $this->settings, $this->conf ); - $mailPreflight->sendSenderMail($mail); + $mailPreflight->sendSenderMail($mail, $this->contentObject->data); } if ($this->isReceiverMailEnabled()) { $mailPreflight = $this->objectManager->get(SendReceiverMailPreflight::class, $this->settings); diff --git a/Classes/Domain/Service/Mail/SendOptinConfirmationMailPreflight.php b/Classes/Domain/Service/Mail/SendOptinConfirmationMailPreflight.php index ea7d76f45..a629961f0 100644 --- a/Classes/Domain/Service/Mail/SendOptinConfirmationMailPreflight.php +++ b/Classes/Domain/Service/Mail/SendOptinConfirmationMailPreflight.php @@ -55,6 +55,7 @@ public function __construct(array $settings, array $conf) /** * @param Mail $mail + * @param array $ttContentData * @return void * @throws InvalidConfigurationTypeException * @throws InvalidControllerNameException @@ -63,7 +64,7 @@ public function __construct(array $settings, array $conf) * @throws InvalidSlotReturnException * @throws Exception */ - public function sendOptinConfirmationMail(Mail $mail): void + public function sendOptinConfirmationMail(Mail $mail, $ttContentData): void { $email = [ 'template' => 'Mail/OptinMail', @@ -86,7 +87,8 @@ public function sendOptinConfirmationMail(Mail $mail): void 'hash' => HashUtility::getHash($mail), 'hashDisclaimer' => HashUtility::getHash($mail, 'disclaimer'), 'mail' => $mail, - 'L' => FrontendUtility::getSysLanguageUid() + 'L' => FrontendUtility::getSysLanguageUid(), + 'ttContentData' => $ttContentData ] ]; $this->sendMailService->sendMail($email, $mail, $this->settings, 'optin'); diff --git a/Classes/Domain/Service/Mail/SendSenderMailPreflight.php b/Classes/Domain/Service/Mail/SendSenderMailPreflight.php index 0d091994a..27330f103 100644 --- a/Classes/Domain/Service/Mail/SendSenderMailPreflight.php +++ b/Classes/Domain/Service/Mail/SendSenderMailPreflight.php @@ -55,6 +55,7 @@ public function __construct(array $settings, array $conf) /** * @param Mail $mail + * @param array $ttContentData * @return void * @throws InvalidConfigurationTypeException * @throws InvalidControllerNameException @@ -63,7 +64,7 @@ public function __construct(array $settings, array $conf) * @throws InvalidSlotReturnException * @throws Exception */ - public function sendSenderMail(Mail $mail): void + public function sendSenderMail(Mail $mail, $ttContentData): void { $senderService = ObjectUtility::getObjectManager()->get(SenderMailPropertiesService::class, $this->settings); $email = [ @@ -82,7 +83,8 @@ public function sendSenderMail(Mail $mail): void 'format' => $this->settings['sender']['mailformat'], 'variables' => [ 'hashDisclaimer' => HashUtility::getHash($mail, 'disclaimer'), - 'L' => FrontendUtility::getSysLanguageUid() + 'L' => FrontendUtility::getSysLanguageUid(), + 'ttContentData' => $ttContentData ] ]; $this->sendMailService->sendMail($email, $mail, $this->settings, 'sender'); diff --git a/Resources/Private/Partials/Mail/DisclaimerLink.html b/Resources/Private/Partials/Mail/DisclaimerLink.html index 580e3640e..b03b10adc 100644 --- a/Resources/Private/Partials/Mail/DisclaimerLink.html +++ b/Resources/Private/Partials/Mail/DisclaimerLink.html @@ -1,6 +1,6 @@

Do you want to delete your request?
- delete + delete

diff --git a/Resources/Private/Templates/Mail/OptinMail.html b/Resources/Private/Templates/Mail/OptinMail.html index 890099244..b4992e50c 100644 --- a/Resources/Private/Templates/Mail/OptinMail.html +++ b/Resources/Private/Templates/Mail/OptinMail.html @@ -9,6 +9,7 @@ {mail} Complete Mail Object {hash} Hash for optin URI {settings} TypoScript Settings + {ttContentData} All values from content element with plugin @@ -16,7 +17,7 @@ - + diff --git a/Resources/Private/Templates/Mail/SenderMail.html b/Resources/Private/Templates/Mail/SenderMail.html index eee5dfdbf..d0de29ff3 100644 --- a/Resources/Private/Templates/Mail/SenderMail.html +++ b/Resources/Private/Templates/Mail/SenderMail.html @@ -9,6 +9,7 @@ {mail} Complete Mail Object {email} Email Configuration {settings} TypoScript Settings +{ttContentData} All values from content element with plugin NOTE: See example section after main section