There is an issue in your Email template file. Your given template file is not found in an assigned block(Magento\Framework\View\Element\Template)
. so you need to create a custom block and have to assign that block to the phtml file.
And extend your custom block to Magento\Framework\View\Element\Template
Check below detail description example.
app/code/Namespace/Modulename/view/frontend/email/test_reminder.html
<tr class="email-information">
<td>
{{layout handle="test_email_log_order_items" items=$items area="frontend"}}
</td>
</tr>
app/code/Namespace/Modulename/view/frontend/layout/test_email_log_order_items.xml
<block class="Namespace\Modulename\Block\EmailLog\Items" name="items" template="email/items.phtml" cacheable="false"></block>
Namespace\Modulename\Block\EmailLog\Items
<?php
namespace Namespace\Modulename\Block\EmailLog;
class Items extends \Magento\Framework\View\Element\Template
{
public function __construct(
\Magento\Framework\View\Element\Template\Context $context,
array $data = array()
) {
parent::__construct($context, $data);
}
}
app/code/Namespace/Modulename/view/frontend/templates/email/items.phtml
<?php
echo "This data is dynamic data and can be changed according to need.";
// You can print data according to your need.
// You can also get the parameters on this file.
?>
app/code/Namespace/Modulename/etc/email_templates.xml
<template id="test_email_template" label="Test email template" file="test_reminder.html" type="html" module="Namespace_Modulename" area="frontend"/>
If you are giving a select email template in system configuration then your config.xml
should be like below.
app/code/Namespace/Modulename/etc/config.xml
<default>
<tabname>
<groupname>
<fieldname>test_email_template</fieldname>
</groupname>
</tabname>
</default>
That's it. It's work for me! I hope it helps.