Skip to main content
deleted 128 characters in body
Source Link
Dhaduk Mitesh
  • 1.7k
  • 1
  • 13
  • 29

Please add this to the PHP file.

$giftcods = ['code1' => 'VFDFRVXSW43VF'['VFDFRVXSW43VF', 'code2' => 'FFRFRFVSW43VF', 'code3' => 'VFDFGFGFXSW43VF']; $templateVars = new \Magento\Framework\DataObject(); $templateVars->setData([ 'store' => $this->storeManager->getStore(), 'customer_name' => $name, 'giftcods' => implode("<br>",$giftcods) ]);]; 

And set in template as ->setTemplateVars(['templateVars' => $templateVars]$templateVars)

Use variable in HTML as,

<div style="color:#696969;font-size:20px;text-align:center;"> <strong>{{var templateVars.giftcods|raw}}</strong> </div> 

Clear cache: php bin/magento cache:clean and check it.

Please add this to PHP file.

$giftcods = ['code1' => 'VFDFRVXSW43VF', 'code2' => 'FFRFRFVSW43VF', 'code3' => 'VFDFGFGFXSW43VF']; $templateVars = new \Magento\Framework\DataObject(); $templateVars->setData([ 'store' => $this->storeManager->getStore(), 'customer_name' => $name, 'giftcods' => implode("<br>",$giftcods) ]); 

And set in template as ->setTemplateVars(['templateVars' => $templateVars])

Use variable in HTML as,

<div style="color:#696969;font-size:20px;text-align:center;"> <strong>{{var templateVars.giftcods|raw}}</strong> </div> 

Clear cache: php bin/magento cache:clean and check it.

Please add this to the PHP file.

$giftcods = ['VFDFRVXSW43VF', 'FFRFRFVSW43VF', 'VFDFGFGFXSW43VF']; $templateVars = [ 'store' => $this->storeManager->getStore(), 'customer_name' => $name, 'giftcods' => implode("<br>",$giftcods) ]; 

And set in template as ->setTemplateVars($templateVars)

Use variable in HTML as,

<div style="color:#696969;font-size:20px;text-align:center;"> <strong>{{var giftcods|raw}}</strong> </div> 

Clear cache: php bin/magento cache:clean and check it.

deleted 24 characters in body
Source Link
Dhaduk Mitesh
  • 1.7k
  • 1
  • 13
  • 29

Please add this to PHP file.

$giftcods = ['code1' => 'VFDFRVXSW43VF', 'code2' => 'FFRFRFVSW43VF', 'code3' => 'VFDFGFGFXSW43VF']; $templateVars = new \Magento\Framework\DataObject(); $templateVars->setData([ 'store' => $this->storeManager->getStore(), 'customer_name' => $name, 'giftcods' => new \Magento\Framework\DataObjectimplode("<br>",$giftcods)  ]); 

And set in template as ->setTemplateVars(['templateVars' => $templateVars])

Use variable in HTML as,

<div style="color:#696969;font-size:20px;text-align:center;"> <strong>{{var templateVars.giftcods.code1|rawgiftcods|raw}}</strong> </div> 

Clear cache: php bin/magento cache:clean and check it.

Please add this to PHP file.

$giftcods = ['code1' => 'VFDFRVXSW43VF', 'code2' => 'FFRFRFVSW43VF', 'code3' => 'VFDFGFGFXSW43VF']; $templateVars = new \Magento\Framework\DataObject(); $templateVars->setData([ 'store' => $this->storeManager->getStore(), 'customer_name' => $name, 'giftcods' => new \Magento\Framework\DataObject($giftcods) ]); 

And set in template as ->setTemplateVars(['templateVars' => $templateVars])

Use variable in HTML as,

<div style="color:#696969;font-size:20px;text-align:center;"> <strong>{{var templateVars.giftcods.code1|raw}}</strong> </div> 

Clear cache: php bin/magento cache:clean and check it.

Please add this to PHP file.

$giftcods = ['code1' => 'VFDFRVXSW43VF', 'code2' => 'FFRFRFVSW43VF', 'code3' => 'VFDFGFGFXSW43VF']; $templateVars = new \Magento\Framework\DataObject(); $templateVars->setData([ 'store' => $this->storeManager->getStore(), 'customer_name' => $name, 'giftcods' => implode("<br>",$giftcods)  ]); 

And set in template as ->setTemplateVars(['templateVars' => $templateVars])

Use variable in HTML as,

<div style="color:#696969;font-size:20px;text-align:center;"> <strong>{{var templateVars.giftcods|raw}}</strong> </div> 

Clear cache: php bin/magento cache:clean and check it.

Source Link
Dhaduk Mitesh
  • 1.7k
  • 1
  • 13
  • 29

Please add this to PHP file.

$giftcods = ['code1' => 'VFDFRVXSW43VF', 'code2' => 'FFRFRFVSW43VF', 'code3' => 'VFDFGFGFXSW43VF']; $templateVars = new \Magento\Framework\DataObject(); $templateVars->setData([ 'store' => $this->storeManager->getStore(), 'customer_name' => $name, 'giftcods' => new \Magento\Framework\DataObject($giftcods) ]); 

And set in template as ->setTemplateVars(['templateVars' => $templateVars])

Use variable in HTML as,

<div style="color:#696969;font-size:20px;text-align:center;"> <strong>{{var templateVars.giftcods.code1|raw}}</strong> </div> 

Clear cache: php bin/magento cache:clean and check it.