1.0.0
Create email content in Salesforce Content Management System (CMS) by using Connect API.
This table lists the use cases that REST API supports for email content.
| Supported Use Case | HTTP Verb | URI |
|---|---|---|
| Create email content | POST | /services/data/{apiVersion}/connect/cms/contents |
| Get email content | GET | /services/data/{apiVersion}/connect/cms/contents/{contentId} |
API Structure
This example shows the structure of an email:
{
"contentSpaceOrFolderId": "0Zuxx00000003M5CAI",
"contentType": "sfdc_cms__email",
"contentBody": {
"sfdc_cms:title": "Email Title",
"sfdc_cms:urlName": "email-url-name",
"sfdc_cms:description": "Email description",
"subjectLine": "Email Subject",
"messagePurpose": "promotional",
"sfdc_cms:block": { ... }
}
}
Content Body Overview
The contentBody property wraps all email-specific content including CMS metadata.
| Property | Data Type | Description |
|---|---|---|
messagePurpose |
string | Required. The purpose of the email message. Possible values are promotional or transactional. |
preheader |
string | Preheader text shown in the preview pane of most email clients. |
sfdc_cms:description |
string | A description that helps identify the email content. |
sfdc_cms:title |
string | Required. The title of the email content. |
sfdc_cms:urlName |
string | A URL-friendly name for the email content. |
subjectLine |
string | Required. The subject line of the email message. |
Content Structure
The sfdc_cms:block property is the primary content structure for emails. It uses a
tree-based architecture where the root block is of type sfdc_cms/rootContentBlock.
Children of this root block can be sections, columns, and various content components.
Each block has a type and definition and can include attributes and children.
Block Types
The block system provides a rich set of components for building email content. See Component Blocks.
Block Structure
This diagram shows the structure of a typical email hierarchy:
sfdc_cms/rootContentBlock (root)
└─ lightning/section (layout)
└─ lightning/column (container)
├─ lightning/heading (content)
├─ lightning/paragraph (content)
├─ lightning/image (content)
├─ lightning/divider (utility)
├─ lightning/list (list)
│ └─ lightning/listElement
│ └─ lightning/listItem
├─ lightning/button (action)
└─ lightning/form (form)
├─ lightning/inputText
├─ lightning/inputEmail
└─ lightning/actionButton
Brand Integration
Most blocks integrate with the brand system through data providers:
{!$brand.colorScheme}: Color schemes{!$brand.typography.heading}: Heading styles{!$brand.typography.paragraph}: Paragraph styles{!$brand.spacing.xSmall}: Spacing values{!$brand.borderRadius.square}: Border styles
Personalization
Several block types support Handlebars for dynamic content.
Let us know so we can improve!