Skip to content

Commit ec24b52

Browse files
author
Raoul Rego
committed
MAGETWO-98377: New customer created from admin for non default store view receives Welcome Email from default store view
Revert "Small refactoring" This reverts commit 3b84172.
1 parent f14be5f commit ec24b52

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

app/code/Magento/Newsletter/Model/Plugin/CustomerPlugin.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,11 +164,12 @@ public function afterDelete(CustomerRepository $subject, $result, CustomerInterf
164164
public function afterGetById(CustomerRepository $subject, CustomerInterface $customer)
165165
{
166166
$extensionAttributes = $customer->getExtensionAttributes();
167-
$storeId = $this->storeManager->getStore()->getId();
168-
$customer->setStoreId($storeId);
167+
169168
if ($extensionAttributes === null) {
170169
/** @var CustomerExtensionInterface $extensionAttributes */
171170
$extensionAttributes = $this->extensionFactory->create(CustomerInterface::class);
171+
$storeId = $this->storeManager->getStore()->getId();
172+
$customer->setStoreId($storeId);
172173
$customer->setExtensionAttributes($extensionAttributes);
173174
}
174175
if ($extensionAttributes->getIsSubscribed() === null) {

0 commit comments

Comments
 (0)