You need to sign in to do that
Don't have an account?
Victoria Riley
Change date format in visualforce email
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>
<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>
Use this code inside your <td></td> tags
All Answers
Use this code inside your <td></td> tags
Here is a screenshot of the opportunity product fields: