diff --git a/vendor/magento/module-customer-graph-ql/Model/Resolver/UpdateCustomerEmail.php b/vendor/magento/module-customer-graph-ql/Model/Resolver/UpdateCustomerEmail.php index e77cea69a3f9d..5e5ffd80d8225 100644 --- a/vendor/magento/module-customer-graph-ql/Model/Resolver/UpdateCustomerEmail.php +++ b/vendor/magento/module-customer-graph-ql/Model/Resolver/UpdateCustomerEmail.php @@ -1,17 +1,21 @@ getCustomer = $getCustomer; $this->updateCustomerAccount = $updateCustomerAccount; $this->extractCustomerData = $extractCustomerData; + $this->emailNotification = $emailNotification + ?? ObjectManager::getInstance()->get(EmailNotificationInterface::class); } /** * Resolve customer email update mutation * - * @param \Magento\Framework\GraphQl\Config\Element\Field $field - * @param \Magento\Framework\GraphQl\Query\Resolver\ContextInterface $context + * @param Field $field + * @param ResolverContext $context * @param ResolveInfo $info * @param array|null $value * @param array|null $args * @return array|Value - * @throws \Exception + * @throws Exception * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function resolve( @@ -77,6 +90,8 @@ public function resolve( } $customer = $this->getCustomer->execute($context); + $customerOriginalEmail = $customer->getEmail(); + $customer->setData('ignore_validation_flag', true); $this->updateCustomerAccount->execute( $customer, [ @@ -85,9 +100,11 @@ public function resolve( ], $context->getExtensionAttributes()->getStore() ); - - $data = $this->extractCustomerData->execute($customer); - - return ['customer' => $data]; + $this->emailNotification->credentialsChanged( + $customer, + $customerOriginalEmail, + false + ); + return ['customer' => $this->extractCustomerData->execute($customer)]; } }