zoukankan      html  css  js  c++  java
  • 调magento自定义模板发邮件

    1. 设置邮件模板

      <global>

        <template>

          <email>

            <custom_email_template1 module="SampleModule1">

              <label>ActiveCodeline custom email module</label>

              <file>activecodeline_custom_email1.html</file>

              <type>html</type>

            </custom_email_template1>

          </email>

        </template>

      </global>

    2. 自定义模板内容  

      <div>     

        <h1>ActiveCodeline custom email example by Branko Ajzele</h1>

        <p>Hi there {{var myvar1}} {{var myvar2}} from {{var myvar3}}. This is just some example template to test custom email module.</p>

      </div>

    3.发送邮件

      $templateVars['myvar1']='Branko';

      $templateVars['myvar2']='Ajzele';

      $templateVars['myvar3']='ActiveCodeline';  

      $emailTemplate  = Mage::getModel('core/email_template');

      
    $emailTemplate->sendTransactional(
      'custom_email_template1',
      array(
      'name'=>'senderName',
      'email'=>'senderEmail'
       ),
      $receiverEmail,
      '251mall',
      $templateVars
      );

      

    作者:冯亮
             
    能力有限,水平一般。如有错误,欢迎指正
  • 相关阅读:
    求一个数的阶乘在 m 进制下末尾 0 的个数
    区间dp
    最长公共子序列变形
    学习stm32专区
    C/C++中static关键字详解
    ASP.NET调用Office Com组件权限设置
    TreeView控件
    SQL笔记(1)索引/触发器
    NPOI 1.2.5 教程
    SQL Povit
  • 原文地址:https://www.cnblogs.com/fengliang/p/4087283.html
Copyright © 2011-2022 走看看