You need to sign in to do that
Don't have an account?
pcmca_2007@yahoo.co.in
Email Templet Sending
Hi All,
I have created a visualforce templet and I want to send the content using this templet.Can anybody provide me
code for Message class for sending mail with VF templet.
with Regards
Prabhash mishra
I would imagine you just call the visualforce page directly - I haven't tried this
This should get you started
Start here - Page.YourVisualForcePage
EmailTemplate EmailTemp [ Select id from EmailTemplate where Name = 'YourTemplateName'];
Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
mail.setTemplateId(EmailTemp.Id);
mail.setSaveAsActivity(true);
mail.setReplyTo('123@213.com);
mail.setSenderDisplayName('Sender');
mail.setWhatId('AssociateId');
mail.setTargetObjectId('Contact OR Lead ID');
Hope this helps!
You should also use for the attachment with templete :-
<messaging:attachment renderAs=" ">
</messaging:attachment>