• Victoria Riley
  • NEWBIE
  • 10 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 3
    Replies
I am trying to change my date format to mm/dd/yy Here is my code (I bolded the line that contains the date):

<messaging:emailTemplate subject="Reserve Your Buy a Day" recipientType="Contact" relatedToType="Opportunity">
    <messaging:htmlEmailBody >
        <body style="font-family: 'Trebuchet MS'">
            <h2>
                Opportunity with Products</h2>
            <hr style="border: solid thin #0099CC" />
            <br />
            <table cellpadding="5" style="border-collapse: collapse" width="100%">
                <tr>
                    <td align="right" 
                        style="border-right-style: solid; border-right-width: thick; border-right-color: #0099CC;" 
                        width="20%">
                        <i>Name</i>
                    </td>
                    <td width="80%">
                        <b>{!relatedTo.Name}</b>
                    </td>
                </tr>
                <tr>
                    <td align="right" 
                        style="border-right-style: solid; border-right-width: thick; border-right-color: #0099CC;" 
                        width="20%">
                        <i>Amount</i>
                    </td>
                    <td width="80%">
                        <b>{!relatedTo.Amount}</b>
                    </td>
                </tr>

           
            </table>
            <br />
            <table cellpadding="5" style="border-collapse: collapse" width="100%">
                <tr>
                    <td style="background-color: #0099CC; color: #FFFFFF">
                        <b>In Memory or Honor</b>
                    </td>
                    <td style="background-color: #0099CC; color: #FFFFFF">
                        <b>Date Reserved</b>
                    </td>
                    <td style="background-color: #0099CC; color: #FFFFFF">
                        <b>Name of Recognition</b>
                    </td>
                </tr>
                <apex:repeat value="{!relatedTo.OpportunityLineItems}" var="lineItem">
                        <tr>
                            <td>
                                {!lineItem.Donation_Type__c}
                            </td>
                            <td>
                                {!lineItem.Calendar_Day_Reserved__c}
                            </td>
                            <td>
                                {!lineItem.Name_of_Recognition__c}
                            </td>
                            <td>
                            </td>                                                            
                        </tr>
                </apex:repeat>
            </table>
        </body>
    </messaging:htmlEmailBody>
</messaging:emailTemplate>
I am trying to replace the standard values (I bolded the fields) with custom values for a picklist field, date field, an text field.  There will be a range of 1 to 10 lines.

Template:
<messaging:emailTemplate recipientType="Contact"
    relatedToType="Opportunity"
    subject="Productline Items for Opportunity: {!relatedTo.name}"
    replyTo="donate@hereforthegirls.org" >
    
<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>Dear {!recipient.name},</p>
        <p>Below is a list of your day(s) for A Calendar to Live By 2018:<b> {!relatedTo.name}</b>.</p>
        <br/>Account: <i> {!relatedTo.Account.name}  </i>  
        <br/>Opportunity Amount: {!ROUND(relatedTo.Amount,0)} 
        <br/>Opportunity Close Date: {!relatedTo.CloseDate}  
   
        <p/>                  
       <table border="0" >
                 <tr > 
                     <th>Action</th><th>Product Name</th><th>Quantity</th><th>Unit Price</th><th>Total Price</th>
                  </tr>
    <apex:repeat var="opp" value="{!relatedTo.OpportunityLineItems}">
       <tr>
           <td><a href="https://na1-blitz01.soma.salesforce.com/{!opp.id}">View</a> |  
           <a href="https://na1-blitz01.soma.salesforce.com/{!opp.id}/e">Edit</a></td>
           <td>{!opp.PriceBookEntry.name}</td>
           <td>{!ROUND(opp.Quantity,0)}</td>
           <td>{!ROUND(opp.UnitPrice,0)}</td>
           <td>{!ROUND(opp.TotalPrice,0)}</td>

       </tr>
    </apex:repeat>                 
       </table>
       <p />
 </font>
       
        </body>
    </html>
</messaging:htmlEmailBody> 
    
<messaging:plainTextEmailBody >
Dear {!recipient.name},
 
Below is a list of products related to the Opportunity: {!relatedTo.name}

Account: {!relatedTo.Account.name}
Opportunity Owner: {!relatedTo.owner.name}
Opportunity Amount: {!ROUND(relatedTo.Amount,0)} 
Opportunity Close Date: {!relatedTo.CloseDate}  


[ Product Name ] - [ Quantity ] - [ Units ] - [ Total Price ]
-------------------------------------------------------------------------

<apex:repeat var="opp" value="{!relatedTo.OpportunityLineItems}">
[ {!opp.PriceBookEntry.name} ] - [ {!ROUND(opp.Quantity,0)} ] - [ {!ROUND(opp.UnitPrice,0)} ] - [ {!ROUND(opp.TotalPrice,0)} ]
</apex:repeat>

</messaging:plainTextEmailBody>       
        
</messaging:emailTemplate>
I have a custom object for event registration.  What is the best way to add up to 10 attendees per registration?
I am trying to change my date format to mm/dd/yy Here is my code (I bolded the line that contains the date):

<messaging:emailTemplate subject="Reserve Your Buy a Day" recipientType="Contact" relatedToType="Opportunity">
    <messaging:htmlEmailBody >
        <body style="font-family: 'Trebuchet MS'">
            <h2>
                Opportunity with Products</h2>
            <hr style="border: solid thin #0099CC" />
            <br />
            <table cellpadding="5" style="border-collapse: collapse" width="100%">
                <tr>
                    <td align="right" 
                        style="border-right-style: solid; border-right-width: thick; border-right-color: #0099CC;" 
                        width="20%">
                        <i>Name</i>
                    </td>
                    <td width="80%">
                        <b>{!relatedTo.Name}</b>
                    </td>
                </tr>
                <tr>
                    <td align="right" 
                        style="border-right-style: solid; border-right-width: thick; border-right-color: #0099CC;" 
                        width="20%">
                        <i>Amount</i>
                    </td>
                    <td width="80%">
                        <b>{!relatedTo.Amount}</b>
                    </td>
                </tr>

           
            </table>
            <br />
            <table cellpadding="5" style="border-collapse: collapse" width="100%">
                <tr>
                    <td style="background-color: #0099CC; color: #FFFFFF">
                        <b>In Memory or Honor</b>
                    </td>
                    <td style="background-color: #0099CC; color: #FFFFFF">
                        <b>Date Reserved</b>
                    </td>
                    <td style="background-color: #0099CC; color: #FFFFFF">
                        <b>Name of Recognition</b>
                    </td>
                </tr>
                <apex:repeat value="{!relatedTo.OpportunityLineItems}" var="lineItem">
                        <tr>
                            <td>
                                {!lineItem.Donation_Type__c}
                            </td>
                            <td>
                                {!lineItem.Calendar_Day_Reserved__c}
                            </td>
                            <td>
                                {!lineItem.Name_of_Recognition__c}
                            </td>
                            <td>
                            </td>                                                            
                        </tr>
                </apex:repeat>
            </table>
        </body>
    </messaging:htmlEmailBody>
</messaging:emailTemplate>