Skip to content

Commit 9221e6e

Browse files
bugfix - customer emails are not being sent from admin if customer is assiged to store "0". "0" should be considered a valid store id
1 parent 929a2c4 commit 9221e6e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ public function credentialsChanged(
167167
private function emailAndPasswordChanged(CustomerInterface $customer, $email)
168168
{
169169
$storeId = $customer->getStoreId();
170-
if (!$storeId) {
170+
if ($storeId === null) {
171171
$storeId = $this->getWebsiteStoreId($customer);
172172
}
173173

@@ -193,7 +193,7 @@ private function emailAndPasswordChanged(CustomerInterface $customer, $email)
193193
private function emailChanged(CustomerInterface $customer, $email)
194194
{
195195
$storeId = $customer->getStoreId();
196-
if (!$storeId) {
196+
if ($storeId === null) {
197197
$storeId = $this->getWebsiteStoreId($customer);
198198
}
199199

@@ -218,7 +218,7 @@ private function emailChanged(CustomerInterface $customer, $email)
218218
private function passwordReset(CustomerInterface $customer)
219219
{
220220
$storeId = $customer->getStoreId();
221-
if (!$storeId) {
221+
if ($storeId === null) {
222222
$storeId = $this->getWebsiteStoreId($customer);
223223
}
224224

@@ -317,7 +317,7 @@ private function getWebsiteStoreId($customer, $defaultStoreId = null)
317317
public function passwordReminder(CustomerInterface $customer)
318318
{
319319
$storeId = $customer->getStoreId();
320-
if (!$storeId) {
320+
if ($storeId === null) {
321321
$storeId = $this->getWebsiteStoreId($customer);
322322
}
323323

@@ -341,7 +341,7 @@ public function passwordReminder(CustomerInterface $customer)
341341
public function passwordResetConfirmation(CustomerInterface $customer)
342342
{
343343
$storeId = $customer->getStoreId();
344-
if (!$storeId) {
344+
if ($storeId === null) {
345345
$storeId = $this->getWebsiteStoreId($customer);
346346
}
347347

@@ -382,7 +382,7 @@ public function newAccount(
382382
);
383383
}
384384

385-
if (!$storeId) {
385+
if ($storeId === null) {
386386
$storeId = $this->getWebsiteStoreId($customer, $sendemailStoreId);
387387
}
388388

0 commit comments

Comments
 (0)