+ Start a Discussion

How can I attach a Knowledge Article to an email using a visualforce template

I would like to use a visualforce template to attache details of a knowledge article.

I have tried using the Articles as PDF field that works for Text and HTML emails, but this does not wotk.

Is there any way to do this??



Messaging.SingleEmailMessage mail=new Messaging.SingleEmailMessage();






template: you can get the ur template id by using EmailTemplate object


Attachments: it must be a child of Messaging.EmailFileattachments class.


It is not working properly.

Only send Email Template and Attachment (Knowladge Article) did not sent.