magento自定义邮件

时间:2014-11-10 17:04:30   收藏:0   阅读:279

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

 

  

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!