You won't be able to get the `size` directly in `visualforce` email template, for that you will have to use the repeat tag to get the count and then you can build further logic based on that variable. <apex:variable var="sizeOfOpportunityLineItem" value="{!0}"/> <apex:repeat value="{!relatedTo.OpportunityLineItems}"> <apex:variable var="sizeOfOpportunityLineItem" value="{!sizeOfOpportunityLineItem + 1}"/> </apex:repeat> Number of Opportunity Line Items : {!sizeOfOpportunityLineItem}