Reference dynamic object, user, and tenant data in templates
Today we're announcing support for referencing objects, users, and tenants dynamically in templates. While we've always exposed properties on the template such as the recipient
, actor
, and tenant
, if you needed to reference other object or user data stored within your Knock environment, you had no access to that within your workflow scope.
Now, with template references, you can load arbitrary objects, users, and tenants into your template context. This allows you to reference any data stored within your Knock environment, such as a different user's profile, a tenant's settings, or an object's properties. Using template references brings access to any kind of third-party object data that you might want to store in Knock, without needing to pass it into your workflow data.
Here's an example. Let's say you're a collaboration product, and you want to show the current project's most up to date title and description in an update email for things happening on that project. With template references, you can load the project object dynamically at execution time by passing in a project_id
into your workflow trigger, and then loading the project object into your template context.
{% assign project = data.project_id | object: "projects" %}
# {{ project.title }}: new updates
> {{ project.description }}
There have been {{ total_activities }} updates on this project in the last 24 hours.
This feature is available now to all Knock customers. You can read more about the feature in our template references documentation.
Fixes and improvements
- π We fixed an issue with the workflow canvas where it would no longer center correctly.
- π We fixed an issue with channel steps in the workflow builder, where it appeared you could change the selected channel in non-development environments.
- π We fixed an issue where cleaning up message history on the deletion of a user would sometimes fail.