@@ -89,6 +89,10 @@ class AccountManagement implements AccountManagementInterface
8989 */
9090 const XML_PATH_FORGOT_EMAIL_IDENTITY = 'customer/password/forgot_email_identity ' ;
9191
92+ /**
93+ * @deprecated
94+ * @see AccountConfirmation::XML_PATH_IS_CONFIRM
95+ */
9296 const XML_PATH_IS_CONFIRM = 'customer/create_account/confirm ' ;
9397
9498 /**
@@ -298,6 +302,11 @@ class AccountManagement implements AccountManagementInterface
298302 */
299303 private $ dateTimeFactory ;
300304
305+ /**
306+ * @var AccountConfirmation
307+ */
308+ private $ accountConfirmation ;
309+
301310 /**
302311 * @param CustomerFactory $customerFactory
303312 * @param ManagerInterface $eventManager
@@ -323,7 +332,8 @@ class AccountManagement implements AccountManagementInterface
323332 * @param ObjectFactory $objectFactory
324333 * @param ExtensibleDataObjectConverter $extensibleDataObjectConverter
325334 * @param CredentialsValidator|null $credentialsValidator
326- * @param DateTimeFactory $dateTimeFactory
335+ * @param DateTimeFactory|null $dateTimeFactory
336+ * @param AccountConfirmation|null $accountConfirmation
327337 * @SuppressWarnings(PHPMD.ExcessiveParameterList)
328338 */
329339 public function __construct (
@@ -351,7 +361,8 @@ public function __construct(
351361 ObjectFactory $ objectFactory ,
352362 ExtensibleDataObjectConverter $ extensibleDataObjectConverter ,
353363 CredentialsValidator $ credentialsValidator = null ,
354- DateTimeFactory $ dateTimeFactory = null
364+ DateTimeFactory $ dateTimeFactory = null ,
365+ AccountConfirmation $ accountConfirmation = null
355366 ) {
356367 $ this ->customerFactory = $ customerFactory ;
357368 $ this ->eventManager = $ eventManager ;
@@ -379,6 +390,8 @@ public function __construct(
379390 $ this ->credentialsValidator =
380391 $ credentialsValidator ?: ObjectManager::getInstance ()->get (CredentialsValidator::class);
381392 $ this ->dateTimeFactory = $ dateTimeFactory ?: ObjectManager::getInstance ()->get (DateTimeFactory::class);
393+ $ this ->accountConfirmation = $ accountConfirmation ?: ObjectManager::getInstance ()
394+ ->get (AccountConfirmation::class);
382395 }
383396
384397 /**
@@ -1149,17 +1162,15 @@ protected function sendEmailTemplate(
11491162 *
11501163 * @param CustomerInterface $customer
11511164 * @return bool
1165+ * @deprecated
1166+ * @see AccountConfirmation::isConfirmationRequired
11521167 */
11531168 protected function isConfirmationRequired ($ customer )
11541169 {
1155- if ($ this ->canSkipConfirmation ($ customer )) {
1156- return false ;
1157- }
1158-
1159- return (bool )$ this ->scopeConfig ->getValue (
1160- self ::XML_PATH_IS_CONFIRM ,
1161- ScopeInterface::SCOPE_WEBSITES ,
1162- $ customer ->getWebsiteId ()
1170+ return $ this ->accountConfirmation ->isConfirmationRequired (
1171+ $ customer ->getWebsiteId (),
1172+ $ customer ->getId (),
1173+ $ customer ->getEmail ()
11631174 );
11641175 }
11651176
@@ -1168,6 +1179,8 @@ protected function isConfirmationRequired($customer)
11681179 *
11691180 * @param CustomerInterface $customer
11701181 * @return bool
1182+ * @deprecated
1183+ * @see AccountConfirmation::isConfirmationRequired
11711184 */
11721185 protected function canSkipConfirmation ($ customer )
11731186 {
0 commit comments