Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.
messaging:htmlEmailBody
The HTML version of the email body.
Example
1<messaging:emailTemplate recipientType="Contact"
2 relatedToType="Account"
3 subject="Case report for Account: {!relatedTo.name}"
4 replyTo="support@acme.com">
5 <messaging:htmlEmailBody>
6 <html>
7 <style type="text/css">
8 body {font-family: Courier; size: 12pt;}
9
10 table {
11 border-width: 5px;
12 border-spacing: 5px;
13 border-style: dashed;
14 border-color: #FF0000;
15 background-color: #FFFFFF;
16 }
17
18 td {
19 border-width: 1px;
20 padding: 4px;
21 border-style: solid;
22 border-color: #000000;
23 background-color: #FFEECC;
24 }
25
26 th {
27 color: #000000;
28 border-width: 1px ;
29 padding: 4px ;
30 border-style: solid ;
31 border-color: #000000;
32 background-color: #FFFFF0;
33 }
34 </style>
35 <body>
36 <p>Dear {!recipient.name},</p>
37 <p>Below is a list of cases related to {!relatedTo.name}.</p>
38 <table border="0" >
39 <tr>
40 <th>Case Number</th><th>Origin</th>
41 <th>Creator Email</th><th>Status</th>
42 </tr>
43 <apex:repeat var="cx" value="{!relatedTo.Cases}">
44 <tr>
45 <td><a href =
46 "https://na1.salesforce.com/{!cx.id}">{!cx.CaseNumber}
47 </a></td>
48 <td>{!cx.Origin}</td>
49 <td>{!cx.Contact.email}</td>
50 <td>{!cx.Status}</td>
51 </tr>
52 </apex:repeat>
53 </table>
54 <p/>
55 <center>
56 <apex:outputLink value="https://salesforce.com">
57 For more detailed information login to Salesforce.com
58 </apex:outputLink>
59 </center>
60
61 </body>
62 </html>
63 </messaging:htmlEmailBody>
64</messaging:emailTemplate>Attributes
| Attribute Name | Attribute Type | Description | Required? | API Version | Access |
|---|---|---|---|---|---|
| id | String | An identifier that allows the htmlEmailBody component to be referenced by other components in the page. | 14.0 | global | |
| rendered | Boolean | A Boolean value that specifies whether the component is rendered on the page. If not specified, this value defaults to true. | 14.0 | global |