Skip to content

Commit 9da91f1

Browse files
committed
MC-42486: Region ID and Country ID values and not properly converted in Email templates
- Added Static and Integration tests
1 parent 4f8cde2 commit 9da91f1

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

app/code/Magento/Email/Model/AbstractTemplate.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,7 @@ protected function getCountryName($store)
823823
ScopeInterface::SCOPE_STORE,
824824
$store
825825
);
826-
if($countryId) {
826+
if ($countryId) {
827827
$countryName = $this->countryInformationAcquirerInterface->getCountryInfo($countryId)->getFullNameLocale();
828828
}
829829
return $countryName;
@@ -844,7 +844,7 @@ protected function getRegionName($store)
844844
ScopeInterface::SCOPE_STORE,
845845
$store
846846
);
847-
if($regionId) {
847+
if ($regionId) {
848848
$regionName = $this->regionFactory->create()->load($regionId)->getName();
849849
}
850850
return $regionName;

app/code/Magento/Newsletter/composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
"magento/module-require-js": "*",
1616
"magento/module-store": "*",
1717
"magento/module-widget": "*",
18-
"magento/module-ui": "*"
18+
"magento/module-ui": "*",
19+
"magento/module-directory": "*"
1920
},
2021
"type": "magento2-module",
2122
"license": [

dev/tests/integration/testsuite/Magento/Email/Model/TemplateTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ protected function mockModel($filesystem = null)
6767
$this->objectManager->get(\Magento\Email\Model\TemplateFactory::class),
6868
$this->objectManager->get(\Magento\Framework\Filter\FilterManager::class),
6969
$this->objectManager->get(\Magento\Framework\UrlInterface::class),
70+
$this->objectManager->get(\Magento\Directory\Api\CountryInformationAcquirerInterface::class),
71+
$this->objectManager->get(\Magento\Directory\Model\RegionFactory::class),
7072
$this->objectManager->get(\Magento\Email\Model\Template\FilterFactory::class),
7173
]
7274
)

0 commit comments

Comments
 (0)