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

Mail Merge Opportunity Line Items

Hello All,


I have a workflow(on Opportunity) which sends out an email with Opportunity details.  

In the email template, I want to merge the 'Opportunity Line Item' but didn't find them.


Is there a way I can get the Opportunity Line items onto the email template? 


Any suggestions please?


Thank you,



Hi VK86,

Were you able to resolve this? I am in a similar situation, I would like to create a mass mail merge where each document has master & detail rows.


Any ideas?






Hello Beener3,


I was able to resolve this using VF email template.

Below is an example Code I used to merge Opportunity Line Items:


<apex:repeat value="{!relatedTo.OpportunityLineItems}" var="line">

          <tr >








The catch here is using the 'apex:repeat' function using which all the 'detail' rows for a master can be merged on email.

Hope this is helpful.