Skip to content

Commit 34b22fe

Browse files
committed
MC-42486: Region ID and Country ID values and not properly converted in Email templates
- Corrected the file based on the review comments.
1 parent c768e1c commit 34b22fe

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

app/code/Magento/Email/Model/Template/Filter.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
use Magento\Variable\Model\VariableFactory;
3838
use Psr\Log\LoggerInterface;
3939
use Magento\Store\Model\Information as StoreInformation;
40+
use \Magento\Framework\App\ObjectManager;
4041

4142
/**
4243
* Core Email Template Filter Model
@@ -250,7 +251,7 @@ public function __construct(
250251
CssInliner $cssInliner,
251252
$variables = [],
252253
array $directiveProcessors = [],
253-
StoreInformation $storeInformation = null
254+
?StoreInformation $storeInformation = null
254255
) {
255256
$this->_escaper = $escaper;
256257
$this->_assetRepo = $assetRepo;
@@ -268,7 +269,7 @@ public function __construct(
268269
$this->pubDirectory = $pubDirectory;
269270
$this->configVariables = $configVariables;
270271
$this->storeInformation = $storeInformation ?:
271-
\Magento\Framework\App\ObjectManager::getInstance()->get(StoreInformation::class);
272+
ObjectManager::getInstance()->get(StoreInformation::class);
272273
parent::__construct($string, $variables, $directiveProcessors, $variableResolver);
273274
}
274275

@@ -851,9 +852,9 @@ public function configDirective($construction)
851852
ScopeInterface::SCOPE_STORE,
852853
$storeId
853854
);
854-
if ($params['path'] == "general/store_information/country_id") {
855+
if ($params['path'] == $this->storeInformation::XML_PATH_STORE_INFO_COUNTRY_CODE) {
855856
$configValue = $storeInformationObj->getData('country');
856-
} elseif ($params['path'] == "general/store_information/region_id") {
857+
} elseif ($params['path'] == $this->storeInformation::XML_PATH_STORE_INFO_REGION_CODE) {
857858
$configValue = $storeInformationObj->getData('region')?
858859
$storeInformationObj->getData('region'):
859860
$configValue;

0 commit comments

Comments
 (0)