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
devSTdevST 

Apex Email Templates for a Case

Hi,

 

After attaching a Knowledge Article to a Case, I would like to know if there is a way to create an apex email template, which could access that article's data?

 

I've created the following working template:

 

 

<messaging:emailTemplate subject="Case Email Template" recipientType="User" relatedToType="Case">
<messaging:htmlEmailBody >
<p>Case Id: {!relatedTo.id},</p>
Congratulations! This is your new Visualforce Email Template. </messaging:htmlEmailBody> </messaging:emailTemplate>

 Is there a way to get to the Knowledge Article object fields from the relatedToType Case object?

 

Thanks!

francoisLfrancoisL

Hi,

 

You can use CaseArticle Object to retrieve which article has been linked to a case and use the article to fill your VF template.

devSTdevST

How would I use the CaseArticle object from within an apex template, which has Case as the related object?

 

Thanks for your help.

RGK.ax912RGK.ax912

Hi

 

did you ever get this to work as I have a similar issue??

 

Thanks

 

Roy