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
mukesh guptamukesh gupta 

Related List Object access on Case Email Template

Hi Expert,

I need to access {!EmailMessage.Subject} on case Email Template. How to achive this.

Many Thanks
Mukesh
 
Rahul KumarRahul Kumar (Salesforce Developers) 
Hi Mukesh,
May I suggest you please refer the below link for reference. Hope it will be helpful.

Please mark it as best answer if the information is informative.so that question is removed from an unanswered question and appear as a proper solution.

Thanks
Rahul Kumar
Sachin P Sam 1Sachin P Sam 1
@mukesh gupta,
this can be achieved by creating a visualforce email template.Email template is included here.
I hope this will help you.

Mark it as best answer if this helped you.

Regards,
Sachin
 
<messaging:emailTemplate subject="send an mail to case owned by you" recipientType="User" relatedToType="Case">
<messaging:htmlEmailBody >
<b>Dear {!relatedTo.Owner.Name}</b><br/>
This are mails send related to Case no. {!relatedTo.CaseNumber}.

<br/><b>Subject:</b> 
<apex:dataTable value="{!relatedTo.EmailMessages}" var="email" border="1">
   <apex:outputText >Subject</apex:outputText>
<apex:column value="{!email.Subject}" /><BR/>
 <apex:column value="{!email.TextBody}" />
  <apex:column value="{!email.CreatedDate}" />
</apex:dataTable>


</messaging:htmlEmailBody>
</messaging:emailTemplate>

 
Sachin P Sam 1Sachin P Sam 1
@mukesh gupta,
Any questions regarding this?
Deepa ParnaDeepa Parna
Hi Sachin,
I have a similar requirement. But in my case as soon as the new case is getting created, a process builder routes the case to the respective queue and sends an email notification to case owner which is a queue. So what should be the recepient type in my case? Please help me.