• Joe Henry 10
  • NEWBIE
  • 0 Points
  • Member since 2022

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
Hello,
Could anyone help me fix the bold portion of this visualforce email template code so that any document attached to the opportunity in the Notes & Attachments section gets included in the email alert as an attachment?

<messaging:emailTemplate recipientType="Contact"
    relatedToType="Opportunity"
    subject="CSF processing request for: {!relatedTo.name}"
    replyTo="xxxx.xxxx@xxx.net" >
   
<messaging:htmlEmailBody >       
    <html>
        <body>
         <STYLE type="text/css">
               TH {font-size: 11px; font-face: arial;background: #CCCCCC; border-width: 1;  text-align: center }
               TD  {font-size: 11px; font-face: verdana }
               TABLE {border: solid #CCCCCC; border-width: 1}
               TR {border: solid #CCCCCC; border-width: 1}
         </STYLE>
                  <font face="arial" size="2">
        <p>CSF PROCESSING REQUEST</p>
        <p>Please find attached the detailed CSF for:<p/>
        <p> Opportunity:<b> {!relatedTo.name}</b>
        <br/>Account: <i><b> {!relatedTo.Account.name}</b>  </i>         
        <br/>Opp ID:<b> {!relatedTo.Opp_ID__c} </b>
        <br/>Opportunity Owner: <b>{!relatedTo.owner.name}</b>
        <br/>Operating Region: <b> {!relatedTo.xxxxxx_Operating_Region2__c}</b>
        <p/>       
       <p />
 </font>
        </body>
    </html>
</messaging:htmlEmailBody>       
       
        <messaging:emailTemplate subject="Opps Signed Documents" recipientType="Contact" relatedToType="Opportunity">
    <messaging:htmlEmailBody >
        <p>Attachments</p>
        <apex:repeat value="{!relatedTo.Attachments}" var="a">
            <p><a href="{!URLFOR($Action.Attachment.Download, a)}">{!a.Name}</a> ({!a.BodyLength} B)</p>
        </apex:repeat>
    </messaging:htmlEmailBody>