Skip to content

Commit 36ecb16

Browse files
Merge branch 'MAGETWO-70628' of github.com:magento-folks/magento2ce into 2.2-bugs
2 parents 32262b8 + d4223dc commit 36ecb16

File tree

2 files changed

+2
-28
lines changed

2 files changed

+2
-28
lines changed

app/code/Magento/Customer/Model/EmailNotification.php

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,6 @@ class EmailNotification implements EmailNotificationInterface
6060
self::NEW_ACCOUNT_EMAIL_CONFIRMATION => self::XML_PATH_CONFIRM_EMAIL_TEMPLATE,
6161
];
6262

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-
7063
/**#@-*/
7164

7265
/**
@@ -248,7 +241,7 @@ private function sendEmailTemplate(
248241
$storeId = null,
249242
$email = null
250243
) {
251-
$templateId = $this->getTemplateId($template, 'store', $storeId);
244+
$templateId = $this->scopeConfig->getValue($template, 'store', $storeId);
252245
if ($email === null) {
253246
$email = $customer->getEmail();
254247
}
@@ -384,23 +377,4 @@ public function newAccount(
384377
$storeId
385378
);
386379
}
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-
}
406380
}

app/code/Magento/Customer/Test/Unit/Model/EmailNotificationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ public function testPasswordResetConfirmation()
545545

546546
$this->scopeConfigMock->expects($this->at(0))
547547
->method('getValue')
548-
->with(EmailNotification::XML_PATH_RESET_PASSWORD_TEMPLATE, ScopeInterface::SCOPE_STORE, $customerStoreId)
548+
->with(EmailNotification::XML_PATH_FORGOT_EMAIL_TEMPLATE, ScopeInterface::SCOPE_STORE, $customerStoreId)
549549
->willReturn($templateIdentifier);
550550
$this->scopeConfigMock->expects($this->at(1))
551551
->method('getValue')

0 commit comments

Comments
 (0)