Skip to main content
The channel element sets content per channel. Send a detailed message on email and a shorter one on push. The type value is "channel". When to use:
  • Provide channel-specific content (different content for email vs push vs SMS)
  • Use raw channel data for provider-specific formats (MJML for email, Slack blocks, etc.)
  • Create channel-specific layouts and structures
Channel elements are only valid at the top level and cannot be nested. If one appears at the top level, every sibling must also be a channel element.
Alternative: most elements support a channels property that shows a single element on chosen channels only. See .
Basic example
Fields
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
Raw data to apply to the channel. Use channel-specific formats like MJML for email, Slack blocks, or webhook payloads. If elements has not been specified, raw is required.
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 . Google Fonts are loaded automatically. Defaults to Helvetica, Arial, sans-serif if omitted.
Examples and 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 Email
  • Supports full Elemental elements or raw HTML/MJML
  • Can use raw.subject for email subject line
  • Supports transformers array for templating engines
Push
  • Typically uses meta.title for 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 raw property
  • Can use provider-specific block structures
  • Supports rich interactive elements per provider