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
Chad RitchieChad Ritchie 

VISUALFORCE email template question

Hey guys, I've attached my email template below. For the repeat part, how would I add a statement saying only repeat and list Opportunities that are 'Rejected'. ---- If(Opp.Status = 'rejected', than loop through them...... Not sure if this would go in the repeat statement or before it. Thanks!

<messaging:emailTemplate subject="Rejected Kits" recipientType="Contact" relatedToType="Contact">
<messaging:htmlEmailBody >
<html>
<style type="text/css">
body {font-family: calibri; size: 11pt;}
</style>
<body>
Dear {!relatedto.First_Name__c},
<br>
<br>
The following kit request(s) were rejected:
<br>
<br>
<apex:repeat var="OPP" value="{!relatedTo.Opportunities__r}">
<table border="1">
   <tr>
        <td>{!OPP.name}</td>   <td>{!OPP.OrderComments__c}</td>
   </tr>
</table>
</apex:repeat>
<br>
<br>
Let me know if there is anything I can do to help.
<br>
<br>
Regards, Chad
</br>
</br>
</br>
</br>
</br>
</br>
</br>
</br>
</body>
</html>
</messaging:htmlEmailBody>
</messaging:emailTemplate>