Question

I need to get custom email template in admin system configuration.

system.xml

This is my email template field code.

<email_template>
    <label>Email Template</label>
    <show_in_default>1</show_in_default>
    <show_in_website>1</show_in_website>
    <show_in_store>1</show_in_store>
    <sort_order>5</sort_order>
    <frontend_type>select</frontend_type>
    <source_model>adminhtml/system_config_source_email_template</source_model>
</email_template>

config.xml

<template>
    <email>
    <custom_email_template translate="label" module="mymodule">
    <label>Custom Email Template</label>
    <file>mymodule/custom_email.html</file>
    <type>html</type>
    </custom_email_template>
    </email>
</template>
<default>
    <mymodulesettings>
      <email>
          <email_template>custom_email_template</email_template>
      </email>
    </mymodulesettings>
</default>

And i have added email.html file in locale/en_US/template/email/mymodule/ path Now i got a outut like this enter image description here

But i need to show my custom email name in that dropdown. like:enter image description here

Was it helpful?

Solution

I have find the solution i made a mistake in my config.xml file.

We have to define the mail template like this

<template>
    <email>
        <{section_name}_{group_name}_{fields_name} translate="label" module="mymodule">
        <label>Custom Email Template</label>
        <file>mymodule/custom_email.html</file>
        <type>html</type>
        </{section_name}_{group_name}_{fields_name}>
    </email>
</template>

{section_name} {group_name} {fields_name} in system.xml file.

Cheers

OTHER TIPS

As i guess you forgot to add your template in Transcriptional emails tab

just follow below steps to do it work,

System > Transactional Emails >

and click ‘Add new template’

Edit if you want to edit your template subject or content. Otherwise leave it as it is.

And then check in your system configuration tab will sure appear in your custom system configuration tab.

I have own tested in my set up it is working for me.

EDIT

enter image description here

hope this will sure help you to solve your custom email template.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top