Skip to content

Commit dd7106b

Browse files
author
Karpenko, Oleksandr
committed
MAGETWO-57656: Base url should be processed while sending email
1 parent 7ef4729 commit dd7106b

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -230,12 +230,13 @@ private function getCssProcessor()
230230

231231
/**
232232
* @deprecated
233+
* @param string $dirType
233234
* @return Filesystem\Directory\ReadInterface
234235
*/
235-
private function getPubDirectory()
236+
private function getPubDirectory($dirType)
236237
{
237238
if (!$this->pubDirectory) {
238-
$this->pubDirectory = ObjectManager::getInstance()->get(Filesystem::class)->getDirectoryRead(DirectoryList::STATIC_VIEW);
239+
$this->pubDirectory = ObjectManager::getInstance()->get(Filesystem::class)->getDirectoryRead($dirType);
239240
}
240241
return $this->pubDirectory;
241242
}
@@ -928,9 +929,9 @@ public function getCssFilesContent(array $files)
928929
try {
929930
foreach ($files as $file) {
930931
$asset = $this->_assetRepo->createAsset($file, $designParams);
931-
$filePath = $asset->getContext()->getPath() . DIRECTORY_SEPARATOR . $file;
932-
if ($this->getPubDirectory()->isExist($filePath)) {
933-
$css .= $this->getPubDirectory()->readFile($filePath);
932+
$pubDirectory = $this->getPubDirectory($asset->getContext()->getBaseDirType());
933+
if ($pubDirectory->isExist($asset->getRelativeSourceFilePath())) {
934+
$css .= $pubDirectory->readFile($asset->getRelativeSourceFilePath());
934935
} else {
935936
$css .= $asset->getContent();
936937
}

0 commit comments

Comments
 (0)