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