Dynamic content block HTML is a Liquid template. When Kit sends an email, it renders your template for each subscriber by substituting Liquid variables with that recipient’s data (automation context, subscriber fields, and other send-time drops available in Kit’s email pipeline).Documentation Index
Fetch the complete documentation index at: https://developers.kit.com/llms.txt
Use this file to discover all available pages before exploring further.
Variable paths
Dynamic content blocks support two data sources, each with its own variable path.Automation event data
When your block is linked to an automation event plugin, event data is accessed through theautomation namespace:
app_identifier— Your app’s unique identifier, assigned in the Kit App Store.event_node_identifier— Theidentifierof the linked automation event plugin element (the event node chosen viarelated_plugin_id), not the dynamic content block plugin’s ownidentifier.field_name— A key from the event data stored for that subscriber (typically aligned with the fields your polling integration puts in each event’scontext).
yourapp and the linked event node’s identifier is abandoned_checkout, you’d access the checkout URL like this:
Subscriber custom fields
Subscriber custom fields are accessible directly via thesubscriber namespace, regardless of whether the block uses an event node:
company:
In the email editor preview for a dynamic content block, Kit renders Liquid using preview context built from
default_values and (when linked) the automation namespace—not the full send-time Liquid environment. In particular, subscriber is not injected on that preview path, so {{ subscriber.* }} may render empty in the editor even though it works at send time. Always verify behavior in a sent test email when mixing subscriber and automation variables.Writing your template
Guard the entire block
Always wrap your content in a top-level conditional. This ensures the block renders gracefully if the automation data isn’t present—for example, if the email is sent outside the expected workflow:Iterate over arrays
Use Liquid’sfor tag to loop over arrays. The limit filter caps the number of items rendered. Always cap loops in email templates to avoid unexpectedly long emails:
Conditionally show fields
Use{% if %} to guard optional fields. Subscribers may have different data states, so don’t assume every field is always populated:
Show overflow counts
When you limit the number of items shown, you can tell subscribers how many more they have:Available Liquid filters
Kit’s email rendering uses Liquid with a supported subset of filters (similar to common Liquid, but not identical to every filter documented for other Liquid hosts). Prefer filters you have verified in a sent test email or editor preview. Commonly useful ones in dynamic content blocks:| Filter | Example | Output |
|---|---|---|
size | {{ products | size }} | Number of items in an array |
minus | {{ total | minus: 4 }} | Subtraction |
join | {{ codes | join: ", " }} | Join array to string |
truncate | {{ name | truncate: 60 }} | Truncate string to N characters |
upcase | {{ label | upcase }} | Uppercase string |
downcase | {{ label | downcase }} | Lowercase string |
Preview vs. send time
Your template is rendered twice:- At design time (editor preview) — Kit renders your template using
default_valuesmerged into theautomationnamespace when an event node is linked (see plugin configuration). Preview does not mirror the full send-time Liquid drop (for example,subscriberis not available on this preview path). - At send time — Kit renders the same stored template with real per-recipient data, including automation context from Visual Automations (when applicable) and the normal
subscriberLiquid drop for subscriber fields.
default_values produce HTML that looks close to what real data would render—creators use this preview to judge how the block will look—and validate anything that depends on subscriber in a sent email, not only in the editor.
Email compatibility
The same security and compatibility rules that apply to standard content blocks also apply to your rendered Liquid template output. Kit sanitizes the final HTML before delivery. Avoid these in your template:- Scripts and iframes
- Audio and video elements
- Form, input, or command elements
- External CSS stylesheets and CSS
url()values
- Use inline
styleattributes instead of CSS classes—email clients strip external stylesheets - Use table-based layouts (
<table>,<tr>,<td>) for reliable rendering across email clients - Keep your maximum width at 600px
- Include
target="_blank"on all links - Use absolute URLs for all images and links
- Guard image fields with
{% if %}so missing images don’t produce broken<img>tags