You need to sign in to do that
Don't have an account?

Is it possible to call a visualforce email template in a visualforce page
HI every one,
I created a visualforce email template in salesforce. After that I created a visualforce page, and I added a text area field in that visualforce page. Is it possible to call that visualforce email template in to this text area. And I want to send the email when I click send button.
Please provide me some info regarding this.If you need more information please let me know that.
Thanks,
Naresh
emailtemplate e=[select id,Name,FolderId,Subject,Description from EmailTemplate where id=:eid];
string s=e.discription;
After click on send compose email
public void sendemail(){
Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
mail.setTargetObjectId(Contactid);//this is for whom you want send email
mail.setTemplateId(e.id);
mail.setWhatId(Opportunityid); //this is which object you want with mergefields.
//if you want attach you can attach attachments
}
Thanks alot for your great help. Can you please let me know what is eid in that first select statement.
(emailtemplate e=[select id,Name,FolderId,Subject,Description from EmailTemplate where id=:eid];)
Thanks,
Naresh
email Template Id.
Thanks for the reply.
Now If I click send button it immediately sends the mail. Can I specify the date and time here.Means in the specified data and time mail should be send in this context. Is it possible to do this in your code.
Please let me know.
Thanks in advance,
Naresh