Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Add section to email links #656

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Classes/Controller/FormController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public function __construct(array $settings, array $conf)

/**
* @param Mail $mail
* @param array $ttContentData
* @return void
* @throws InvalidConfigurationTypeException
* @throws InvalidControllerNameException
Expand All @@ -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',
Expand All @@ -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');
Expand Down
6 changes: 4 additions & 2 deletions Classes/Domain/Service/Mail/SendSenderMailPreflight.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public function __construct(array $settings, array $conf)

/**
* @param Mail $mail
* @param array $ttContentData
* @return void
* @throws InvalidConfigurationTypeException
* @throws InvalidControllerNameException
Expand All @@ -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 = [
Expand All @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion Resources/Private/Partials/Mail/DisclaimerLink.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<f:if condition="{settings.sender.addDisclaimerLink} && {mail.uid}">
<p>
<f:translate key="disclaimer_mailmessage">Do you want to delete your request?</f:translate><br />
<f:link.action action="disclaimer" absolute="1" arguments="{mail:mail,hash:hashDisclaimer}" additionalParams="{L:L}"><f:translate key="disclaimer_mailmessage_link">delete</f:translate></f:link.action>
<f:link.action action="disclaimer" absolute="1" arguments="{mail:mail,hash:hashDisclaimer}" additionalParams="{L:L}" section="c{ttContentData.uid}"><f:translate key="disclaimer_mailmessage_link">delete</f:translate></f:link.action>
</p>
</f:if>
3 changes: 2 additions & 1 deletion Resources/Private/Templates/Mail/OptinMail.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@
{mail} Complete Mail Object
{hash} Hash for optin URI
{settings} TypoScript Settings
{ttContentData} All values from content element with plugin


<f:section name="main">
<f:translate key="optin_mail_link" /><br>

<f:format.htmlentitiesDecode>
<f:link.action action="optinConfirm" absolute="1" arguments="{hash: hash, mail: mail}">
<f:uri.action action="optinConfirm" absolute="1" arguments="{hash: hash, mail: mail}" />
<f:uri.action action="optinConfirm" absolute="1" arguments="{hash: hash, mail: mail}" section="c{ttContentData.uid}" />
</f:link.action>
</f:format.htmlentitiesDecode>

Expand Down
1 change: 1 addition & 0 deletions Resources/Private/Templates/Mail/SenderMail.html
Original file line number Diff line number Diff line change
Expand Up @@ -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

<f:section name="main">
Expand Down