在系统配置magento中获取自定义电子邮件模板?

Mee*_*m R 3 email magento system-configuration magento-1.7

我需要在管理系统配置中获取自定义电子邮件模板.

的system.xml

这是我的电子邮件模板字段代码.

<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>
Run Code Online (Sandbox Code Playgroud)

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>
Run Code Online (Sandbox Code Playgroud)

我已经在locale/en_US/template/email/mymodule/path中添加了email.html文件现在我得到了像这样的输出 在此输入图像描述

但我需要在该下拉列表中显示我的自定义电子邮件名称.喜欢:在此输入图像描述

Mee*_*m R 5

我发现解决方案我在config.xml文件中犯了一个错误.

我们必须像这样定义邮件模板

<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>
Run Code Online (Sandbox Code Playgroud)

system.xml文件中的{section_name} {group_name} {fields_name} .

干杯