Skip to content

Commit 31c5137

Browse files
author
silinmykola
committed
33310 change strict resolver to fix empty email template variables
1 parent dfe2a28 commit 31c5137

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

app/code/Magento/Newsletter/Model/Queue.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,6 @@ public function sendPerSubscriber($count = 20)
253253

254254
/** @var \Magento\Newsletter\Model\Subscriber $item */
255255
foreach ($collection->getItems() as $item) {
256-
$item->setData('unsubscriptionLink', $item->getUnsubscriptionLink());
257256
$transport = $this->_transportBuilder->setTemplateOptions(
258257
['area' => \Magento\Framework\App\Area::AREA_FRONTEND, 'store' => $item->getStoreId()]
259258
)->setTemplateVars(

app/code/Magento/Newsletter/Model/Template.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ public function getTemplateText()
224224
'template_text',
225225
__(
226226
'Follow this link to unsubscribe <!-- This tag is for unsubscribe link -->' .
227-
'<a href="{{var subscriber.unsubscriptionLink}}">{{var subscriber.unsubscriptionLink}}' .
227+
'<a href="{{var subscriber.getUnsubscriptionLink()}}">{{var subscriber.getUnsubscriptionLink()}}' .
228228
'</a>'
229229
)
230230
);

app/code/Magento/Newsletter/i18n/en_US.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ Paused,Paused
9191
"You selected an invalid queue.","You selected an invalid queue."
9292
"We cannot mark as received subscriber.","We cannot mark as received subscriber."
9393
"Duplicate template code","Duplicate template code"
94-
"Follow this link to unsubscribe <!-- This tag is for unsubscribe link --><a href=""{{var subscriber.unsubscriptionLink}}"">{{var subscriber.unsubscriptionLink}}</a>","Follow this link to unsubscribe <!-- This tag is for unsubscribe link --><a href=""{{var subscriber.unsubscriptionLink}}"">{{var subscriber.unsubscriptionLink}}</a>"
94+
"Follow this link to unsubscribe <!-- This tag is for unsubscribe link --><a href=""{{var subscriber.getUnsubscriptionLink()}}"">{{var subscriber.getUnsubscriptionLink()}}</a>","Follow this link to unsubscribe <!-- This tag is for unsubscribe link --><a href=""{{var subscriber.getUnsubscriptionLink()}}"">{{var subscriber.getUnsubscriptionLink()}}</a>"
9595
"No such entity with %fieldName = %fieldValue","No such entity with %fieldName = %fieldValue"
9696
"Choose Store View:","Choose Store View:"
9797
"Newsletter Message Preview","Newsletter Message Preview"

lib/internal/Magento/Framework/Filter/VariableResolver/StrictResolver.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,10 @@ private function handleGetterMethod(int $i, Template $filter, array $templateVar
115115
...$stackArgs[$i]['args']
116116
);
117117
} else {
118-
$dataKey = $this->extractDataKeyFromGetter($stackArgs[$i]['name']);
119-
$stackArgs[$i]['variable'] = $stackArgs[$i - 1]['variable']->getData($dataKey);
118+
$stackArgs[$i]['variable'] = call_user_func_array(
119+
[$stackArgs[$i - 1]['variable'], $stackArgs[$i]['name']],
120+
$stackArgs[$i]['args']
121+
);
120122
}
121123
}
122124

0 commit comments

Comments
 (0)