Skip to content

Commit

Permalink
Merge pull request #1162 from plentymarkets/fix/password_link
Browse files Browse the repository at this point in the history
ADD: parameter to detect the correct webstore
  • Loading branch information
stentrop authored Feb 20, 2023
2 parents 8345a79 + 10a8773 commit 2923d8c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/Extensions/Mail/IOSendMail.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ public function handle(PluginSendMail $pluginSendMail)
[
"template" => $pluginSendMail->getTemplate(),
"email" => $pluginSendMail->getContactEmail(),
"callFunction" => $pluginSendMail->getCallFunction()
"callFunction" => $pluginSendMail->getCallFunction(),
"webstoreId" => $pluginSendMail->getWebstoreId() ?? null
]
);

Expand All @@ -59,8 +60,13 @@ public function handle(PluginSendMail $pluginSendMail)

if (in_array(RouteConfig::PASSWORD_RESET, RouteConfig::getEnabledRoutes()) && strlen($pluginSendMail->getContactEmail())) {
/** @var ContactRepositoryContract $contactRepository */

$filter = [];
if (!is_null($pluginSendMail->getWebstoreId())) {
$filter['webstoreId'] = $pluginSendMail->getWebstoreId();
}
$contactRepository = pluginApp(ContactRepositoryContract::class);
$contactId = $contactRepository->getContactIdByEmail($pluginSendMail->getContactEmail());
$contactId = $contactRepository->getContactIdByEmail($pluginSendMail->getContactEmail(), $filter);

if ($contactId === null) {
$this->setPlaceholderValue('Link_NewPassword', '');
Expand Down

0 comments on commit 2923d8c

Please sign in to comment.