Skip to main content
The text element renders a body of text. It supports formatting and styling, and can contain inline text content elements (string, link, img). The type value is "text". 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
string
The text content displayed in the notification. Either this field or the elements field must be specified. Supports Handlebars variables.
TextContentElement[]
An array of Text Content Elements (string, link, img). Either this field or content must be specified, or both. When both are present, elements takes precedence and content is ignored. See the Text content elements section below.
string
Text alignment. One of "left", "center", or "right". Defaults to "left".
string
Renders the text as a heading level. One of "text", "h1", "h2", or "subtext". Defaults to "text".
string
The text color. Any valid CSS color value (e.g., "#007bff", "rgb(0, 123, 255)").
boolean
Apply bold formatting to the text.
boolean
Apply italic formatting to the text.
boolean
Apply a strikethrough to the text.
boolean
Apply an underline to the text.
object
Region-specific content for localization. A text-node locale entry can include content (a string), elements (a structured array of inline nodes), or both. When both are provided, elements takes precedence. See the .
string[]
An array of channel names. The text renders only for the listed channels. See .
Examples and variants Basic text Simple text content:
Text with Handlebars Dynamic text with variables:
Variables come from message.data (e.g., data.first_name). Styled text Text with formatting:
Localized text Text with translations using the content string format:
Localized text with structured elements When your text node uses the elements 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. Choose one format per node. The same applies to locale entries.
If a text node uses elements but a locale only provides content, Courier wraps that string into a single-element array for backward compatibility. Rendering still works, but any inline formatting is lost. Provide elements in your locale translations to keep it. See the 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, the content field. These sub-elements build inline text with links, images, and formatted strings.
Text content elements (string, link, img) must be children of a text element. They cannot stand alone as top-level elements.
String element Renders a simple string. Behaves like default text, but formats inline within a text element. Fields:
string
required
Must be "string".
string
required
The text content displayed in the notification.
string
Text alignment. One of "left", "center", or "right".
string
Renders the text as a heading level. One of "text", "h1", "h2", or "subtext".
string
The text color. Any valid CSS color value.
boolean
Apply bold formatting to the text.
boolean
Apply italic formatting to the text.
boolean
Apply a strikethrough to the text.
boolean
Apply an underline to the text.
object
Region-specific content for localization.
Link element Renders a clickable link within a body of text. Fields:
string
required
Must be "link".
string
required
The text content of the link (the clickable text).
string
The address to link to. When provided, the link becomes clickable.
boolean
Disable click tracking for the link. By default, Courier tracks link clicks.
string
Text alignment. One of "left", "center", or "right".
string
Renders the text as a heading level. One of "text", "h1", "h2", or "subtext".
string
The text color. Any valid CSS color value.
boolean
Apply bold formatting to the text.
boolean
Apply italic formatting to the text.
boolean
Apply a strikethrough to the text.
boolean
Apply an underline to the text.
object
Region-specific content for localization.
Img element Renders an image inline within a body of text. Fields:
string
required
Must be "img".
string
required
The source address of the image. Must be a publicly accessible URL.
string
Text used for screen readers and displayed on mouse hover. Important for accessibility.
string
How wide the image renders. Any valid CSS width value (e.g., "50px", "100%").
string
An address to link to. Makes the image clickable.
boolean
Disable click tracking for the link (if href is provided).
string
Text alignment. One of "left", "center", or "right".
string
Renders the text as a heading level. One of "text", "h1", "h2", or "subtext".
string
The text color, for any text overlay.
boolean
Apply bold formatting (for any text overlay).
boolean
Apply italic formatting (for any text overlay).
boolean
Apply a strikethrough (for any text overlay).
boolean
Apply an underline (for any text overlay).
object
Region-specific content for localization. Can localize src and href.
Text with inline links Combine strings and links:
Text with inline images Include images within text:
Rich formatted text Mix strings, links, and formatting:
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

Best practices

  • Use content for simple text: plain text needs nothing more
  • Use elements for rich formatting: inline links, images, or mixed styling
  • Avoid specifying both: elements takes precedence and content is ignored. Pick one format per node
  • Match locale format to root format: if your text node uses elements, provide elements in your locales. A content-only locale works but loses inline formatting
  • Keep text concise: long paragraphs are hard to read, especially in email
  • Use headings appropriately: use text_style for a proper heading hierarchy