@@ -60,6 +60,10 @@ class EmailNotification implements EmailNotificationInterface
60
60
self ::NEW_ACCOUNT_EMAIL_CONFIRMATION => self ::XML_PATH_CONFIRM_EMAIL_TEMPLATE ,
61
61
];
62
62
63
+ const TEMPLATE_MAP = [
64
+ self ::XML_PATH_FORGOT_EMAIL_TEMPLATE => self ::XML_PATH_RESET_PASSWORD_TEMPLATE
65
+ ];
66
+
63
67
/**#@-*/
64
68
65
69
/**
@@ -241,11 +245,10 @@ private function sendEmailTemplate(
241
245
$ storeId = null ,
242
246
$ email = null
243
247
) {
244
- $ templateId = $ this ->scopeConfig -> getValue ($ template , 'store ' , $ storeId );
248
+ $ templateId = $ this ->getCorrectTemplateId ($ template , 'store ' , $ storeId );
245
249
if ($ email === null ) {
246
250
$ email = $ customer ->getEmail ();
247
251
}
248
-
249
252
$ transport = $ this ->transportBuilder ->setTemplateIdentifier ($ templateId )
250
253
->setTemplateOptions (['area ' => 'frontend ' , 'store ' => $ storeId ])
251
254
->setTemplateVars ($ templateParams )
@@ -378,4 +381,23 @@ public function newAccount(
378
381
$ storeId
379
382
);
380
383
}
384
+
385
+ /**
386
+ * Get templateId include considering template map
387
+ *
388
+ * @param string $template
389
+ * @param string $scopeType
390
+ * @param string $storeId
391
+ * @return string
392
+ */
393
+ private function getCorrectTemplateId ($ template , $ scopeType , $ storeId )
394
+ {
395
+ if (array_key_exists ($ template , self ::TEMPLATE_MAP )) {
396
+ $ templateId = $ this ->scopeConfig ->getValue (self ::TEMPLATE_MAP [$ template ], $ scopeType , $ storeId );
397
+ if ($ templateId ) {
398
+ return $ templateId ;
399
+ }
400
+ }
401
+ return $ this ->scopeConfig ->getValue ($ template , $ scopeType , $ storeId );
402
+ }
381
403
}
0 commit comments