Magento – Magento 2 : System Configuration select email templates not working

configurationemail-templatesmagento2

I'm trying to render a select field with email templates under Sytemem->Configuration
.
When i open the configuration tab it doenst show any config fields more.

Here are my files

etc/system.xml

  <field id="pickup_template" translate="label comment" type="select" sortOrder="3" showInDefault="1" showInWebsite="1" showInStore="1">
                <label>New Order Confirmation Template for Guest</label>
                <comment>Email template chosen based on theme fallback when "Default" option is selected.</comment>
                <source_model>Magento\Config\Model\Config\Source\Email\Template</source_model>
  </field>

etc/email_templates.xml

   <template id="pickup_template" label="New Order" file="yourfile.html" type="html" module="Hello_StorePickup" area="frontend"/>

view/frontend/email/yourfile.html

    <b>message</b>

Best Answer

Get Section id and group id of that field For example Section id= id1 and group id = id2

and your etc/email_templates.xml like this

  <template id="id1_id2_pickup_template" label="New Order" file="yourfile.html" type="html" module="Hello_StorePickup" area="frontend"/>