3

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

MeenakshiSundaram R
  • 2,837
  • 3
  • 29
  • 41

2 Answers2

5

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

MeenakshiSundaram R
  • 2,837
  • 3
  • 29
  • 41
1

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.

liyakat
  • 11,825
  • 2
  • 40
  • 46
  • thanks for a reply. But in AW Blog extension show their email template in drop down.With out add new template in system>transnational email.I do a code same like the blog code in my module – MeenakshiSundaram R Sep 23 '13 at 05:32
  • this is default selection from xml it is not fetching your custom name from transaction email. if you want to display in drop down you should have to follow above steps. and i am sure it will work because it is working at my end. – liyakat Sep 23 '13 at 06:14
  • just follow steps above there is no need for program to do. i think. and i would be glad if u will vote up and acpt my answer. – liyakat Sep 23 '13 at 07:14
  • pls follow this steps http://www.magentocommerce.com/knowledge-base/entry/customizing-transactional-emails sure will help you – liyakat Sep 23 '13 at 07:16
  • could you see AW blog extension code.please see this http://www.magentocommerce.com/magento-connect/blog-community-edition.html please install this in your extension and go system>conifg>blog>comments email template – MeenakshiSundaram R Sep 23 '13 at 09:37
  • pls check my updated answer and see.i am requesting you. pls dont argue any more. i am confident about my work and test.i would be appreciate if you will acpt and vote up my correct answer. – liyakat Sep 23 '13 at 09:50
  • i fix the issue by this http://magento.stackexchange.com/questions/8346/getting-custom-email-template-name-in-system-configuration – MeenakshiSundaram R Sep 23 '13 at 11:54
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/37877/discussion-between-meenakshi-sundaram-r-and-liyakat) – MeenakshiSundaram R Sep 23 '13 at 11:55
  • so you forget to add some tag or something wrong with you confog.xml pls let me knwp – liyakat Sep 23 '13 at 12:23
  • we have to add a email template name in config.xml like section_group_field – MeenakshiSundaram R Sep 23 '13 at 13:01