Overview
A channel element scopes a block of content to one delivery channel. Give each channel its own channel element at the top level to tailor a notification per channel, for example a detailed layout for email and a short message for push. Each channel element holds its content one of two ways: anelements array of Elemental blocks, or a raw object carrying a provider-specific payload (HTML or MJML for email, Slack blocks, a webhook body). A channel needs at least one of the two.
Common uses
- Different content for email, push, and SMS from one template
- Provider-specific formats through
raw(MJML, Slack blocks, webhook payloads) - A dedicated, editable structure for an email template (see Providing email content)
channels property that shows or hides that element per channel. See Control Flow.
Providing Email Content
For email, put your content inside a singlechannel: email element. This is the standard structure for email templates: Design Studio stores them this way, and it keeps a template editable in the visual editor. Placing blocks at the top level also sends, but is not recommended.
Within the channel element, provide content in one of two forms.
Elemental blocks: populate elements with meta, text, image, action, and other blocks. Each block renders and stays individually editable in Design Studio.
raw.html (see Using raw data). Courier renders it as-is, as a single unit that is not editable block by block, so use it to port an existing HTML email whole. Keep a meta block for the subject, since raw.html has none.
Blocks vs. Raw HTML
Fields
string
required
The type of element. For channel elements, this value must be
"channel".string
required
The channel the contents of this element should be applied to. Can be:
- Standard channels:
"email","push","direct_message","sms" - Provider names:
"slack","discord","teams", etc. "default"- applies to all channels not explicitly specified
CourierElement[]
An array of Elemental elements to apply to the channel. If
raw has not been specified, elements is required.object
Provider-specific content for the channel, used instead of
elements (a channel needs one or the other, and may include both, for example raw.html for the body plus a meta block in elements for the subject). Common keys:html(string): full HTML document for email.text(string): plain-text body or fallback.subject(string): email subject line.transformers(string[]): formatting passes to apply, such as["handlebars"]or["handlebars", "mjml"].blocks/payload(object): provider-specific structures, such as Slack blocks or a webhook body.
string
The CSS
font-family stack to apply to the rendered email. Only valid when channel is "email". Use the exact fontFamily value from the font catalog. Google Fonts are loaded automatically. Defaults to Helvetica, Arial, sans-serif if omitted.string
The page background color shown behind the email content card. Only valid when
channel is "email". Any valid CSS color value. Design Studio 2.0 sets this from the template’s background.string
The background color of the email content card itself. Only valid when
channel is "email". Any valid CSS color value. Design Studio 2.0 sets this from the template’s content background.string
Body padding applied once around the whole email body, as a CSS px shorthand of one to four values (e.g.,
"48px" or "48px 64px"). Only valid when channel is "email". This is document-level spacing and is separate from the padding you can set on an individual text, action, or image block.string
The base font size for the email’s body content, as a CSS px value (e.g.,
"16px"). Only valid when channel is "email". Applies to text, quote, and list blocks and to action button labels. Heading styles (h1, h2) and subtext keep their preset sizes. See Document-level typography and spacing.string
The line height for the email’s body content, as a CSS px value or a unitless multiplier (e.g.,
"24px" or "1.5"). Only valid when channel is "email". Applies to all body content unless a block overrides it.Document-Level Typography and Spacing
padding, font_size, and line_height on the email channel element set the defaults for the whole email, so you style a template once instead of repeating the same values on every block. All three are email-only; other channels ignore them.
What Each Field Covers
Precedence
A value set on a block always wins over the document-level value:- Block-level —
font_sizeorline_heighton an individualtextorquoteblock. - Document-level —
font_sizeorline_heighton the email channel element. - Courier’s default — used when neither is set.
The two levels treat headings differently, which is intentional. Document-level
font_size deliberately skips headings so your heading hierarchy survives a change to body size. Block-level font_size does override the text_style preset, so it’s the field to use when you want one specific heading at a custom size.Examples & Variants
Using Elements
Provide different Elemental content per channel:Using Raw Data
Use raw channel data for provider-specific formats:Email with MJML
Slack
Webhook
Default Channel
Use"default" to provide content for all channels not explicitly specified:
Channel-Specific Considerations
- Supports full Elemental elements or raw HTML/MJML
- Can use
raw.subjectfor email subject line - Supports
transformersarray for templating engines
Push
- Typically uses
meta.titlefor notification title - Content should be concise due to character limits
- Supports action buttons via action elements
SMS
- Very limited character count
- Best for short, essential messages
- No rich formatting support
Direct Message (Slack, Discord, Teams, etc.)
- Provider-specific formats via
rawproperty - Can use provider-specific block structures
- Supports rich interactive elements per provider
Related Elements
- Meta Element - For channel-specific titles and subjects
- Text Element - For channel-specific body content
- Action Element - For channel-specific call-to-action buttons
- Control Flow - For using
channelsproperty on individual elements