1,使用component+Controller+VF的方式,步骤如下:
》创建一个 Visualforce格式的Email Template;
》创建Apex Componet,例子伪代码如下
Public Class xxxxxCtrl {
public String xxxId{get;set;} /** get set the variable for opportunity Id take value from visual component.**/
public List<Product_Config_Item__c> getProductItems() {
return [Select Id,...
from xxxxobj
where id=:xxxId
];
}
}
<!--组件名称为:XXXComponet-->
<apex:component controller="xxxxxCtrl " access="global">
<apex:attribute access="global" assignTo="{!xxxId}" name="proConfigId" type="String" required="true" description="Product Config Id"/>
<b>products Details</b>
<br/>
<br/>
<table border="1" cellSpacing="0" cellp