I need to pass the phtml file into email template. but I'm getting error like
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"}}
Thanks in advance.
Best Answer
Write below code in email template to call custom phtml file.
You can pass custom data in $custom_var to PHTML file.
Vendor/Module/view/frontend/layout/custom_email_data.xml
Vendor/Module/view/frontend/templates/email/custom.phtml