Overview
The channel element allows you to customize notification content based on which channel the notification is sent through. For example, you can display a detailed message in email and a more concise message in push notifications. 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
Basic Example
Fields
The type of element. For channel elements, this value must be
"channel".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
An array of Elemental elements to apply to the channel. If
raw has not been specified, elements is required.Raw data to apply to the channel. This allows you to provide channel-specific formats like MJML for email, Slack blocks, or webhook payloads. If
elements has not been specified, raw is required.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