@@ -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 /**
@@ -1161,17 +1174,15 @@ protected function sendEmailTemplate(
11611174 *
11621175 * @param CustomerInterface $customer
11631176 * @return bool
1177+ * @deprecated
1178+ * @see AccountConfirmation::isConfirmationRequired
11641179 */
11651180 protected function isConfirmationRequired ($ customer )
11661181 {
1167- if ($ this ->canSkipConfirmation ($ customer )) {
1168- return false ;
1169- }
1170-
1171- return (bool )$ this ->scopeConfig ->getValue (
1172- self ::XML_PATH_IS_CONFIRM ,
1173- ScopeInterface::SCOPE_WEBSITES ,
1174- $ customer ->getWebsiteId ()
1182+ return $ this ->accountConfirmation ->isConfirmationRequired (
1183+ $ customer ->getWebsiteId (),
1184+ $ customer ->getId (),
1185+ $ customer ->getEmail ()
11751186 );
11761187 }
11771188
@@ -1180,6 +1191,8 @@ protected function isConfirmationRequired($customer)
11801191 *
11811192 * @param CustomerInterface $customer
11821193 * @return bool
1194+ * @deprecated
1195+ * @see AccountConfirmation::isConfirmationRequired
11831196 */
11841197 protected function canSkipConfirmation ($ customer )
11851198 {
0 commit comments