+ Start a Discussion
rohit.mehtarohit.mehta 

My Personal Email Templates

Hello,
 
I have a requirement to retrieve all the email templates from the user's 'My Personal Email Templates' folder.
 
Is there a way to programatically retrieve this information?
 
 
Thanks,
Rohit
micwamicwa
First select the folder id and then query all emailtemplates in that folder:

Code:
Id folderId = [Select f.Name, f.Id From Folder f where f.Name = 'My Personal Email Templates'].Id;

List<EmailTemplate> = [Select e.Subject, e.Name, e.Id, e.FolderId, e.Body From EmailTemplate e where e.FolderId = :folderId];

 

rohit.mehtarohit.mehta
Hi,

Thanks for the reply.

This query does not return any value.
I think is a special folder as each user would be having his own 'My Personal Email Templates' folder.

Thanks,
Rohit