Skip to content

Commit 8479d2f

Browse files
authored
ENGCOM-7445: Bugfix - Customer emails are not being sent from admin if customer is from store "0" #26293
2 parents cd77da6 + 6016b94 commit 8479d2f

File tree

2 files changed

+166
-111
lines changed

2 files changed

+166
-111
lines changed

app/code/Magento/Customer/Model/EmailNotification.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ public function credentialsChanged(
170170
private function emailAndPasswordChanged(CustomerInterface $customer, $email): void
171171
{
172172
$storeId = $customer->getStoreId();
173-
if (!$storeId) {
173+
if ($storeId === null) {
174174
$storeId = $this->getWebsiteStoreId($customer);
175175
}
176176

@@ -196,7 +196,7 @@ private function emailAndPasswordChanged(CustomerInterface $customer, $email): v
196196
private function emailChanged(CustomerInterface $customer, $email): void
197197
{
198198
$storeId = $customer->getStoreId();
199-
if (!$storeId) {
199+
if ($storeId === null) {
200200
$storeId = $this->getWebsiteStoreId($customer);
201201
}
202202

@@ -221,7 +221,7 @@ private function emailChanged(CustomerInterface $customer, $email): void
221221
private function passwordReset(CustomerInterface $customer): void
222222
{
223223
$storeId = $customer->getStoreId();
224-
if (!$storeId) {
224+
if ($storeId === null) {
225225
$storeId = $this->getWebsiteStoreId($customer);
226226
}
227227

@@ -320,7 +320,7 @@ private function getWebsiteStoreId($customer, $defaultStoreId = null): int
320320
public function passwordReminder(CustomerInterface $customer): void
321321
{
322322
$storeId = $customer->getStoreId();
323-
if (!$storeId) {
323+
if ($storeId === null) {
324324
$storeId = $this->getWebsiteStoreId($customer);
325325
}
326326

@@ -344,7 +344,7 @@ public function passwordReminder(CustomerInterface $customer): void
344344
public function passwordResetConfirmation(CustomerInterface $customer): void
345345
{
346346
$storeId = $customer->getStoreId();
347-
if (!$storeId) {
347+
if ($storeId === null) {
348348
$storeId = $this->getWebsiteStoreId($customer);
349349
}
350350

@@ -365,7 +365,7 @@ public function passwordResetConfirmation(CustomerInterface $customer): void
365365
* @param CustomerInterface $customer
366366
* @param string $type
367367
* @param string $backUrl
368-
* @param int $storeId
368+
* @param int|null $storeId
369369
* @param string $sendemailStoreId
370370
* @return void
371371
* @throws LocalizedException
@@ -374,7 +374,7 @@ public function newAccount(
374374
CustomerInterface $customer,
375375
$type = self::NEW_ACCOUNT_EMAIL_REGISTERED,
376376
$backUrl = '',
377-
$storeId = 0,
377+
$storeId = null,
378378
$sendemailStoreId = null
379379
): void {
380380
$types = self::TEMPLATE_TYPES;
@@ -385,7 +385,7 @@ public function newAccount(
385385
);
386386
}
387387

388-
if (!$storeId) {
388+
if ($storeId === null) {
389389
$storeId = $this->getWebsiteStoreId($customer, $sendemailStoreId);
390390
}
391391

0 commit comments

Comments
 (0)