1

モジュールを作成しました。カスタム メール テンプレートの一部を [メール テンプレート] ドロップダウンのオプションとして追加したいと考えていますAdmin > System > Configuration > Customers > Customer Configuration

次のように、カスタムモジュールにノードを追加しようとしました

<global>
    <template>
        <email>
            <customer_account_create_template>
                ...
            </customer_account_create_template>
        </email>
    </template>
</global>

これを書いたときはコードを持っていなかったので、customer_account_create_template間違っているかもしれませんが、カスタム テンプレートでオプションを正常に置き換えたことに注意してください。

ポイントは、デフォルトのものを置き換えるのではなく、別のオプションとして追加したかったということです。それで、あなたは何か考えがありますか?

4

1 に答える 1

-1

グローバルタグ内でテンプレートを宣言し、ラベルをconfig.xml付ける必要があります。

<global>
    <template>
        <email>
            <custom_email_template translate="label" module="yourcustommodule">
                <label>Custom Email Template</label><!-- this should be shown in the config dropdown-->
                <file>mymodule/custom_email.html</file>
                <type>html</type>
            </custom_email_template>
        </email>
    </template>
</global>

system.xml フィールドは、テンプレートの名前と一致する必要があり_ instead of /ます。あなたの場合、custom_email_template.

したがって、次のsystem.xmlようになります。

<sections>
    <custom ...>
       <groups>
           <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>
              </template>
           </email>
       </groups>
    </custom>
</sections>

そして、<default>タグconfig.xml

  <default>
        <custom>
          <email>
              <template1>custom_email_template1</template1>
              <template2>custom_email_template2</template2>
          </email>
        </custom> 
    </default>
于 2013-09-25T04:41:03.467 に答える