Skip to content

magento man

Magento 2.3.5 order email observer custom block enable to pass array

I have tried the following: Observer … $transport = $observer->getTransport(); $transport->setTemplateVars([ ‘products’ => [ [‘name’ => ‘Product1’], [‘name’ => ‘Product2′] ] ]); … order_new_guest.html {{block class=’Magento\Framework\View\Element\Template’ area=’frontend’ template=’Vendor_Module::email/template.phtml’ products=$products}} email/template.phtml <p>HELLO!</p> <?php //print_r(count($this->getProducts())); ?> <?php foreach ($this->getProducts() as $_item): ?>… Read More »Magento 2.3.5 order email observer custom block enable to pass array