i create a system xml to load a field dropdown for selecting email template, but when i access the configuration page there is an error like this:
Exception #0 (UnexpectedValueException): Email template 'paymentconfirmation_general_payment_confirmation_email' is not defined.
here's my system.xml:
<group id="general" showInDefault="1" showInStore="1" showInWebsite="1" sortOrder="10" translate="label">
<label>Payment Confirmation E-Mail</label>
<field id="email" showInDefault="1" showInStore="1" showInWebsite="1" sortOrder="1" translate="label" type="text">
<label>Store E-Mail Receivers</label>
<comment>Insert ',' between e-mail addresses</comment>
</field>
<field id="payment_confirmation_email" translate="label comment" type="select" sortOrder="2" showInDefault="1" showInWebsite="1" showInStore="1">
<label>E-Mail Template</label>
<source_model>Magento\Config\Model\Config\Source\Email\Template</source_model>
</field>
</group>
here's my config.xml:
<?xml version="1.0" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">
<default>
<paymentconfirmation>
<general>
<email/>
<payment_confirmation_email/>
</general>
</paymentconfirmation>
</default>
</config>