gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-01 18:44:15 24 4
gpt4 key购买 nike

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

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>

我已经在 locale/en_US/template/email/mymodule/路径中添加了 email.html 文件现在我得到了这样的输出 enter image description here

但我需要在该下拉列表中显示我的自定义电子邮件名称。例如:enter image description here

最佳答案

我找到了我在 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>

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

干杯

关于magento - 在系统配置magento中获取自定义电子邮件模板?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18947326/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com