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
Ben RosenthalBen Rosenthal 

Error: Syntax error. Found '}'

I'm so close to building my first Visualforce Email Template. I've resolved a bunch of errors and am now stuck with a syntax error of an extra right brace. However, I can't find it anywhere in my code. Can you help me sleuth?

Thanks!

<pre>
<messaging:emailTemplate recipientType="Contact"
    relatedToType="Opportunity"
    subject="Thank you for your donation to Nourish!"
    replyTo="gratitude@wildernesstorah.org" >
    
<messaging:htmlEmailBody >        
    <html>
        <body>
<p style="text-align: center;">
    <img alt="User-added image" height="193" src="https://c.na14.content.force.com/servlet/rtaImage?eid=a0pd0000006DBex&feoid=00Nd0000007bCrt&refid=0EMd00000001WEE" width="500" /></p>
<table align="center" cellpadding="0" cellspacing="0" class="bodytbl" style="font-family: Helvetica,Arial,sans-serif; font-size: 12px; color: #787878;" width="80%">
    <tbody>
        <tr style="font-size: 12px; font-family: arial,helvetica,sans-serif;">
            <td colspan="1" rowspan="1" style="" valign="top" width="25%">
                <p>
                    <a href="http://www.slingshotfund.org/directory/wilderness-torah/" target="_blank"><img align="left" alt="" border="0" src="https://c.na14.content.force.com/servlet/servlet.ImageServer?id=015d0000005vUvm&oid=00Dd0000000borB" /></a><br />
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                    <br />
                    &nbsp;</p>
                <p>
                    <span style="font-size: 14px;"><strong><em>“One of the nation’s<br />
                    most innovative<br />
                    Jewish nonprofits.”</em></strong></span><br />
                    <strong style="font-size: smaller;"><em>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;~ Slingshot Fund, 2011–2015</em></strong><br />
                    &nbsp;</p>
                <p>
                    <strong>Wilderness Torah</strong><br />
                    2095 Rose Street<br />
                    Suite 202<br />
                    Berkeley, CA 94709<br />
                    <a href="http://wildernesstorah.org/" target="_blank">wildernesstorah.org</a><br />
                    &nbsp;</p>
                <p>
                    <strong><em>Board of Directors</em></strong><br />
                    Adam Weisberg,<br />
                    &nbsp;&nbsp;<em>President</em><br />
                    Terry Cumes,<br />
                    &nbsp;&nbsp;<em>Treasurer</em><br />
                    Susie Aaron<br />
                    Leah Katz Ahmadi<br />
                    Jim Gilbert<br />
                    Sam Goldman<br />
                    Shira Weissman<br />
                    Brian Williams<br />
                    Julie Wolk<br />
                    &nbsp;</p>
                <p>
                    <strong><em>Staff</em></strong><br />
                    Zelig Golden,<br />
                    &nbsp;&nbsp;<em>Founding Director</em><br />
                    Nancy Shaw,<br />
                    &nbsp;&nbsp;<em>Managing Director</em><br />
                    Aya Baron<br />
                    Flora Goldman<br />
                    Sam Pashall<br />
                    Suzannah Sosman<br />
                    &nbsp;</p>
                <p>
                    <strong><em>Wilderness Torah</em></strong><br />
                    a 501(c)(3) organization<br />
                    Federal Tax ID<br />
                    45-4437061</p>
            </td>
                        <td colspan="1" rowspan="1" style="padding-left: 5%;" valign="top" width="95%">
                <div class="h" style="font-size: 12px; font-family: arial,helvetica,sans-serif;">
                    <p style="text-align: right;">
                    {!relatedTo.<DateToday__c>}</p>
        
                    <p>
Dear {!relatedTo.PrimaryContact__r.FirstName},</p>
            <p>
Thank you so much for donating the item(s) below to Wilderness Torah’s online silent auction this year! We so appreciate your support of Wilderness Torah with your fabulous gift. This letter serves as your tax acknowledgement letter.</p>
                    <p>
We’re thrilled to have raised $6,700 from over 50 wonderful items. This year, your item was promoted via:</p>
                    <ul>
                        <li>
Facebook ads, seen by more than 20,000 people</li>
<li>Many posts on our Facebook page, which has more than 3,000 fans</li>
<li>The auction website, which was viewed by nearly 3,500 people and received almost 200 bids</li>
<li>Our e-newsletter, sent to over 2,500 subscribers</li>
                    </ul>
                    <p>
Your donation supports thousands of people to unplug and reconnect to nourishing, earth-based Jewish traditions and education. Thank you!</p>
                    <p>
With great appreciation,</p>
                    <table style="">
                        <tbody>
                            <tr>
                                <td colspan="1" rowspan="1">
<img align="left" alt="" border="0" src="https://c.na14.content.force.com/servlet/servlet.ImageServer?id=015d0000005vUxZ&oid=00Dd0000000borB" style="" /><br />
                                    Nancy Shaw<br />
                                    Managing Director</td>
                                <td colspan="1" rowspan="1">
<img align="none" alt="" border="0" src="https://c.na14.content.force.com/servlet/servlet.ImageServer?id=015d0000005vwF0&oid=00Dd0000000borB" /><br />
                                    Zelig Golden<br />
                                    Founding Director</td>
                            </tr>
                        </tbody>
                    </table>
                                <apex:repeat var="opp" value="{!relatedTo.OpportunityLineItems}">
       <tr>
           <td>{!opp.PriceBookEntry.name}</td>
           <td>{!ROUND(opp.TotalPrice,0)}</td>
       </tr>
    </apex:repeat>                 

                    <p style="font-size: 10px;">
                        We acknowledge that no goods or services were received in connection to this donation. Wilderness Torah is a registered 501(c)(3) organization. Contributions to Wilderness Torah are tax-deductible. Please keep this letter as a record of your donation for your tax purposes.</p>
                    <p style="text-align: center;">
-------------------------For your tax records-------------------------</p>
                    <dl>
                        <dt>
<strong>Donor Name</strong>:&nbsp;{!relatedTo.Account__r.Name}</dt>
                        <dt>
<strong>Donation Amount</strong>: ${!relatedTo.Amount}</dt>
                        <dt>
                           <strong>Transaction Date</strong>: {!relatedTo.<CloseDateSpelledOut__c>}</dt>
                    </dl>
                </div>
            </td>
        </tr>
    </tbody>
</table>
       
        </body>
    </html>
</messaging:htmlEmailBody> 
            
</messaging:emailTemplate>
</pre>
Paul_BoikoPaul_Boiko
Why are you using "<", ">" here 
{!relatedTo.<DateToday__c>}
 (line 74) ? try to remove them : 
{!relatedTo.DateToday__c}

 and see if it fixes the issue.
Ben RosenthalBen Rosenthal
Thanks! I guess I don't need to use the angle brackets for custom fields, as I gathered from another forum reference. The next error is regarding the {!relatedTo.Account__r.Name} reference near the end. It doesn't like "Account__r."

What's the appropriate way to look up the name of the Account related to the Opportunity?
Paul_BoikoPaul_Boiko
Since Account is standard field you don't need to use "__r" just {!relatedTo.Account.Name}. If it would custom lookup or master-detail relationship field then you would need to use "__r".
Ben RosenthalBen Rosenthal
Excellent! Thanks for your help. Template is really coming together now.