Templates are essentially blueprints where certain parts can be replaced with specific data. They consist of fixed text along with placeholders denoted by double curly brackets ( Consider the following template: When rendered with a GitHub The output will be:
Currently, only webhook bodies of type
Warning: As the jq library is a third-party tool, some features may not be fully supported. We are working on providing a template-playground soon to make testing and experimenting with templates easier.
How to Use Templates
What Are Templates?
{{ }}
). These placeholders will be substituted with actual values when the template is rendered.
Example Usage
New Issue in Hooks.im Repository, Opened by {{ .issue.user.login }} - Title: {{ .issue.title }}
issues.opened
(documentation) JSON webhook body:Selectors and JSON Webhook Bodies
application/json
are supported for template interpretation. A pure Go implementation of jq is used to process the selectors. Please note that as this relies on a third-party library, not all jq features may be supported.
Sample Templates
Name
Target
Description
Template
Example
GitHub Issue
GitHub
Template for GitHub issue creation.
New Issue in hooks.im repository, opened by {{ .issue.user.login }} with the title: {{ .issue.title }}
New Issue in hooks.im repository, opened by krizz with the title: Template is not working!