Skip to content

Commit ebabae0

Browse files
committed
add missing delay variable in email
1 parent f409bbb commit ebabae0

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

Model/Customer/Notifier/MailSender.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Magento\Framework\Exception\NoSuchEntityException;
1616
use Magento\Framework\Mail\Template\TransportBuilder;
1717
use Magento\Store\Model\StoreManagerInterface;
18+
use Opengento\Gdpr\Model\EraseEntityManagement;
1819
use Opengento\Gdpr\Model\Notifier\AbstractMailSender;
1920

2021
class MailSender extends AbstractMailSender implements SenderInterface
@@ -24,6 +25,7 @@ class MailSender extends AbstractMailSender implements SenderInterface
2425
private StoreManagerInterface $storeManager;
2526

2627
public function __construct(
28+
protected EraseEntityManagement $entityManagement,
2729
View $customerViewHelper,
2830
TransportBuilder $transportBuilder,
2931
ScopeConfigInterface $scopeConfig,
@@ -42,8 +44,11 @@ public function __construct(
4244
*/
4345
public function send(CustomerInterface $customer): void
4446
{
47+
$delay = $this->entityManagement->resolveErasureDelay();
48+
4549
$storeId = $customer->getStoreId() === null ? null : (int)$customer->getStoreId();
4650
$vars = [
51+
'delay' => $delay !== 0 ? $delay / 60 : 0,
4752
'customer' => $customer,
4853
'store' => $this->storeManager->getStore($customer->getStoreId()),
4954
'customer_data' => [

Model/EraseEntityManagement.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ private function retrieveScheduledAt(): string
9898
);
9999
}
100100

101-
private function resolveErasureDelay(): int
101+
public function resolveErasureDelay(): int
102102
{
103103
return (int)$this->scopeConfig->getValue(self::CONFIG_PATH_ERASURE_DELAY);
104104
}

view/frontend/email/erase_pending.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<tr class="email-summary">
2020
<td>
2121
<p>{{trans "We have received a request to erase the information associated with your account at %store_name." store_name=$store.getFrontendName()}}</p>
22-
<p>{{trans 'You can cancel the erase within %delay hours by <a href="%account_url">logging into your account</a>.' account_url=$this.getUrl($store,'customer/account/',[_nosid:1]) |raw}}</p>
22+
<p>{{trans 'You can cancel the erase within %delay hours by <a href="%account_url">logging into your account</a>.' delay=$delay account_url=$this.getUrl($store,'customer/account/',[_nosid:1]) |raw}}</p>
2323
</td>
2424
</tr>
2525
<tr class="help-info">

view/frontend/email/erase_pending_guest.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<tr class="email-summary">
2020
<td>
2121
<p>{{trans "We have received a request to erase the information associated with your account at %store_name." store_name=$store.getFrontendName()}}</p>
22-
<p>{{trans 'You can cancel the erase within %delay hours by <a href="%account_url">logging into your account</a>.' account_url=$this.getUrl($store,'customer/account/',[_nosid:1]) |raw}}</p>
22+
<p>{{trans 'You can cancel the erase within %delay hours by <a href="%account_url">logging into your account</a>.' delay=$delay account_url=$this.getUrl($store,'customer/account/',[_nosid:1]) |raw}}</p>
2323
</td>
2424
</tr>
2525
<tr class="help-info">

0 commit comments

Comments
 (0)