+ Start a Discussion
Rakesh SRakesh S 

display list of email templates in visualforce page

Hi all,

I have an requirement to display list of email templates in visualforce.
like this display list of email templates
i want to do this using apex. can you please suggest, how can i do...

Thank you.
kumar tanwarkumar tanwar
Hello Rakesh,
Please see below link to show EmailTemplete in VF Page..
In addtion to kumar's post refer below link to findout available fields and more on EmailTemplate object

Hi Rakesh ,
Your requirement is not so complex ,You need to do a simple query from EmailTemplate Object and needs to display in VF page .
If you want to display template from aparticular folder then above link will help .As we are storing template inside a folder always .
Again Folder is also an Object in salesforce you can query like template in salesforce and add filter as per your requirment .

Try with below code it will help !
public class DisplayEmailTemplate {
Public List<EmailTemplate> tempList{get;set;}
public DisplayEmailTemplate(){
tempList=new List<EmailTemplate>();
 tempList=[ SELECT Name,Subject,TemplateType,Description FROM EmailTemplate];
<apex:page controller="DisplayEmailTemplate">
	     <apex:pageBlockTable value="{!tempList}" var="temRec">
			<apex:column  value="{!temRec.Name}" headerValue="Name"/>
			<apex:column  value="{!temRec.TemplateType}" headerValue="Subject"/>
			<apex:column  value="{!temRec.Description}" headerValue="Description"/>