| 
	Magento的Mage::getModel('core/email_template')模型可用来发信。  
	步骤I.  
	在你的模块(其实任意Module都可以)的etc/config.xml的根标签<config>下添加代码  
	Xml代码  收藏代码 
	<default>   
	    <{限定名1}>   
	        <{限定名n}>   
	            <enabled>1</enabled>   
	            <template>{email模板标签名}</template>   
	        </{限定名n}>   
	    </限定名>   
	</default>   
	<global>   
	    <template>   
	      <email>   
	        <{{email模板标签名} translate="label" module="{模块名}">   
	          <label>{任何标识性名}</label>   
	          <file>{email模板html文件名}</file>   
	          <type>html</type>   
	         </{email模板标签名>   
	      </email>   
	    </template>   
	</global>   
	a).在global/template/email下定义新的email模板标签,模板文件名。模板文件名类似CMS页,要放到app/locale/{当前语种}/template/email目录或子目录下  
	b). default/下限定名1...限定名N围绕的template引用global下定义的email模板  
	限定名1...限定名N表示标签可以嵌套一层或多层用于与其他default下标签区分。  
	一个例如下:  
	Xml代码  收藏代码 
	<default>   
	    <customer_email>   
	        <services_request>   
	            <enabled>1</enabled>   
	            <template>customer_email_service_template</template>   
	        </services_request>   
	    </customer_email>   
	</default>   
	<global>   
	    <template>   
	        <email>   
	            <customer_email_service_template translate="label" module="sales">   
	               <label>Customer Services Request</label>   
	               <file>customer_services.html</file>   
	               <type>html</type>   
	            </customer_email_service_template>   
	        </email>   
	    </template>   
	</global>   
	步骤II.  
	创建customer_services.html放到app/locale/{当前语种}/template/email目录下(内容省略).  
	步骤III. 代码调用例  
	/* @var $translate Mage_Core_Model_Translate */   
	$translate = Mage::getSingleton('core/translate');   
	$translate->setTranslateInline(false);   
	$storeId  = Mage::app()->getStore()->getId();   
	$template = Mage::getStoreConfig('customer_email/services_request/template', $storeId);   
	$recipient = array(   
	    'name'  => 'Baby',   
	    'email' => 'elon.guo@gmail.com'   
	);   
	$sender  = array(   
	    'name'  => 'Koda Guo',   
	    'email' => 'koda.guo@gmail.com'   
	);   
	$mailTemplate = Mage::getModel('core/email_template');   
	$mailTemplate->setDesignConfig(array('area'=>'frontend', 'store'=>$storeId))   
	    ->sendTransactional(   
	        $template,   
	        $sender,   
	        $recipient['email'],   
	        $recipient['name'],   
	        array( // parameters to email   
	            'param1'=> 'abc',   
	            'param2'=> 'def',   
	            'param3'=> 'ghi'   
	        )   
	    );   
	       $translate->setTranslateInline(true);   
	使用Magento模板机制,一旦定义了新的模板,就可以在后台System->Transactional Mail处定制该模板,从而方便维护.(责任编辑:最模板) | 



 空包代发刷快递单空包网
							人气:3590
							空包代发刷快递单空包网
							人气:3590
						 ecshop仿钻石小鸟2016整站模
							人气:932
							ecshop仿钻石小鸟2016整站模
							人气:932
						 ecshop仿天猫超市2016整站模
							人气:1699
							ecshop仿天猫超市2016整站模
							人气:1699
						 ecshop仿优雅100家纺商城模
							人气:681
							ecshop仿优雅100家纺商城模
							人气:681
						 ecshop仿唯棉模板
							人气:996
							ecshop仿唯棉模板
							人气:996
						 ecshop简洁通用外贸模板
							人气:1429
							ecshop简洁通用外贸模板
							人气:1429