I need to pass the phtml file into email template. but I'm getting error like
Error Log :
Error filtering template: Invalid template file:
'Vendor_Module::emailproducts.phtml' in module: '' block's name:
'magento\framework\view\element\template_0'
I used below code in email template.
{{block class="Magento\Framework\View\Element\Template" name="email_template" area='frontend' template="Vendor_Module::emailproducts.phtml"}}
Phtml template file path
app/code/Vendor/Module/view/frontend/templates/emailproducts.phtml
Thanks in advance.
Best Answer
You need to pass something like below in your email.html file.
Create layout file as product_stock_alert_items.xml in layout folder. Add content in it like below.
And now create .phtml as stock.phtml in template folder and add your phtml content in it.