A detailed look at Text Block functionality, use cases and best practices.
Working With Text Blocks
Availability: All channels
Text Block Options
- Variables: In every channel and integration, customized text can be inserted with variables.
- Background Color: Sets the background color behind the text.
- Insert Bulleted List: Use this option for static bulleted lists. See list blocks for dynamic list content.
- Hyperlink: You have the option to hyperlink text in a Text Block in every channel.
Hide or Show Text With Inline Conditions
Conditional text lets you show or hide text within any Text Block in any channel. Using filters that show or hide the text in-line based on data from the data or profile objects sent with the Send API call.
A typical use case for inline text conditions is creating a fallback greeting when you don't have a user's name.
- Highlight the
profile.namevariable in your template and create a condition to hide it when the name property is empty.
- Highlight your fallback text,
therefor example, and set a condition to show when
profile.nameproperty is empty so your sentences renders as
Hi there,instead of
Cross-Channel Formatting Behaviors
Courier automatically adjusts any text formating to align with the channel and integration limitations when you drag text blocks in from the shared content library.
- Text blocks in email offer options such as inline images, bulleted lists, header text (H1, H2), subtext, text color, and text alignment that are not available in other channels such as SMS, push, or Slack.
- You can also insert images inline:
- Highlight Text:
- Add a static bulleted list (for dynamic lists that pull from an array, see list blocks):
- Bold and Italic formatting is available in certain direct message text blocks.
- SMS does not allow text formatting, so any formatted text using bold, italics, headers, subtext, background-colors or alignment will revert to plain text.
- Formatted anchor links become URL hyperlinks when pulled into an SMS from the shared library.
Hide Text Blocks With Conditions
It is possible to hide a Text Block or any other type of block using conditional filters. When the User Profile data matches the filter rules, the block will be hidden.