function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
RGK.ax912RGK.ax912 

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??

Thanks

cloudmaniacloudmania

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

 

 mail.setTemplateId(tempate*);

 

mail.setFileAttachments(attachments*);

 

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

 

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

Anil_VaishnavAnil_Vaishnav

It is not working properly.

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