码迷,mamicode.com
首页 > 其他好文 > 详细

magento自定义邮件

时间:2014-11-10 17:04:30      阅读:279      评论:0      收藏:0      [点我收藏+]

标签:style   io   color   ar   os   sp   for   div   on   

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
  );

 

  

magento自定义邮件

标签:style   io   color   ar   os   sp   for   div   on   

原文地址:http://www.cnblogs.com/fengliang/p/4087283.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!