Skip to main content
Availability: Slack, Microsoft Teams Jsonnet Blocks enable you to create dynamic, customized content for Slack and Microsoft Teams notifications using the Jsonnet templating language. Jsonnet is a JSON to JSON templating language, which means that combining Jsonnet with your user data allows you to build and send dynamic, custom Slack blocks and MS Teams Adaptive Cards in your notifications.
New Jsonnet Block

New Jsonnet Block

Key Features

Data Integration

  • Access data using the data("variable") syntax
  • Access profile data using the profile("variable") syntax
  • Dynamically populate message content based on profile attributes or event data.
Referencing Data Payload:
[
  {
    "type": "context",
    "elements": [
      {
        "type": "plain_text",
        "text": ":wave: There's a new comment from " + data("commenter"), //commenter would be the variable that can be found in the data payload
        "emoji": true
      }
    ]
  }
]
Referencing Profile Data:
[
  {
    "type": "context",
    "elements": [
      {
        "type": "plain_text",
        "text": ":wave: There's a new comment on the investigation from " + profile("name"),
        "emoji": true
      }
    ]
  }
]

Templating

  • Use Jsonnet’s templating features to create reusable components
  • Apply conditional logic to show or hide parts of your message

Platform-Specific Elements

Courier-Provided Templates

Courier offers several pre-built Jsonnet template blocks for common Block Kit actions:
  • Buttons
  • Dropdowns
  • Images
  • Text sections
  • And more…
These templates can serve as starting points for your custom designs.

Custom Block Kit Elements

You can also build your own Block Kit elements from scratch. The Jsonnet Block expects either a single Block Kit element or an array of elements.