Overview
The text element represents a body of text to be rendered inside of the notification. It’s one of the most commonly used elements and supports rich formatting, styling, and can contain inline text content elements (string, link, img) for more complex text structures. When to use:- Display body text, paragraphs, and descriptions
- Create headings and subheadings
- Show formatted text with styling (bold, italic, colors)
- Include inline links and images within text
- Display dynamic content with Handlebars variables
Basic Example
Fields
The type of element. For text elements, this value must be
"text".The text content displayed in the notification. Either this field or the
elements field must be specified. Supports Handlebars variables for dynamic content.An array of Text Content Elements (string, link, img). Either this field or the
content field must be specified. Both can also be provided — when both are present, elements takes precedence and content is ignored. See the Text Content Elements section below.Text alignment. One of
"left", "center", or "right". Defaults to "left".Allows the text to be rendered as a heading level. Can be
"text", "h1", "h2", or "subtext". Defaults to "text".Specifies the color of text. Can be any valid CSS color value (e.g.,
"#007bff", "rgb(0, 123, 255)").Apply bold formatting to the text.
Apply italic formatting to the text.
Apply a strikethrough to the text.
Apply an underline to the text.
Region-specific content for localization. Locale entries for text nodes can include
content (a string), elements (a structured array of inline nodes), or both. When both are provided, elements takes precedence. See the Locales documentation for more details.An array of channel names. The text will only be rendered for the specified channels. See Control Flow documentation for details.
Examples & Variants
Basic Text
Simple text content:Text with Handlebars
Dynamic text with variables:message.data (e.g., data.first_name).
Styled Text
Text with formatting:Localized Text
Text with translations using thecontent string format:
Localized Text with Structured Elements
When your text node uses theelements array, provide locale translations as elements arrays to preserve inline formatting across languages:
When Both content and elements Are Present
If a text node includes both content and elements, only elements is used — content is ignored. We recommend choosing one format per node to keep your templates clear. The same applies to locale entries.
If a text node uses
elements but a locale only provides content, Courier wraps the content string into a single-element array for backward compatibility. This preserves rendering but loses any inline formatting the original elements may have had. For full formatting fidelity, provide elements in your locale translations. See the Locales documentation for the full resolution table.Heading Styles
Use text as headings:Text Content Elements
The text element can contain an array of text content elements instead of (or in addition to) thecontent field. These sub-elements allow you to create rich, inline text with links, images, and formatted strings.
Text content elements (string, link, img) must be children of a text element. They cannot be used as standalone top-level elements.
String Element
Renders a simple string. Similar to default text behavior but allows for inline formatting within a text element. Fields:The type of element. For string elements, this value must be
"string".The text content displayed in the notification.
Text alignment. One of
"left", "center", or "right".Allows the text to be rendered as a heading level. Can be
"text", "h1", "h2", or "subtext".Specifies the color of text. Can be any valid CSS color value.
Apply bold formatting to the text.
Apply italic formatting to the text.
Apply a strikethrough to the text.
Apply an underline to the text.
Region-specific content for localization.
Link Element
Renders a clickable link within a body of text. Fields:The type of element. For link elements, this value must be
"link".The text content of the link (the clickable text).
The address to link to. When provided, the link becomes clickable.
Disable click tracking for the link. By default, Courier tracks link clicks.
Text alignment. One of
"left", "center", or "right".Allows the text to be rendered as a heading level. Can be
"text", "h1", "h2", or "subtext".Specifies the color of text. Can be any valid CSS color value.
Apply bold formatting to the text.
Apply italic formatting to the text.
Apply a strikethrough to the text.
Apply an underline to the text.
Region-specific content for localization.
Img Element
Renders an image inline within a body of text. Fields:The type of element. For inline image elements, this value must be
"img".The source address of the image. Must be a publicly accessible URL.
Text used for screen readers and displayed on mouse hover. Important for accessibility.
How wide the image should render. Can be any valid CSS width value (e.g.,
"50px", "100%").An address to link to. Makes the image clickable.
Disable click tracking for the link (if
href is provided).Text alignment. One of
"left", "center", or "right".Allows the text to be rendered as a heading level. Can be
"text", "h1", "h2", or "subtext".Specifies the color of text (for any text overlay).
Apply bold formatting (for any text overlay).
Apply italic formatting (for any text overlay).
Apply a strikethrough (for any text overlay).
Apply an underline (for any text overlay).
Region-specific content for localization. Can localize
src and href.Examples with Text Content Elements
Text with Inline Links
Combine strings and links:Text with Inline Images
Include images within text:Rich Formatted Text
Mix strings, links, and formatting:Text with Multiple Links
Multiple links in one text element:Best Practices
- Use
contentfor simple text: When you just need plain text, use thecontentfield - Use
elementsfor rich formatting: Use theelementsarray when you need inline links, images, or complex formatting - Avoid specifying both: When both
contentandelementsare present,elementstakes precedence andcontentis ignored. Pick one format per node - Match locale format to root format: If your text node uses
elements, provideelementsin your locales to preserve formatting. Acontent-only locale on anelementsnode will work but loses inline formatting - Keep text concise: Long paragraphs can be hard to read, especially in email
- Use headings appropriately: Use
text_styleto create proper heading hierarchy - Test formatting: Different channels may render formatting differently
Channel Support
- Email: ✅ Full support with all formatting options
- Push: ✅ Supported (formatting may be limited)
- SMS: ⚠️ Limited support (plain text only)
- Inbox: ✅ Full support with rich formatting
Related Elements
- Action Element - For standalone buttons and links
- Image Element - For standalone images
- Quote Element - For quote blocks
- Group Element - For grouping text with other elements
- Locales - For localizing text content
- Control Flow - For conditional rendering and loops