mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-25 00:07:47 +01:00
feat(integrations): ability to add stringified event (#6642)
You might want to include entire event, but as a different field.
This commit is contained in:
parent
df9229a90c
commit
d3eac6caf8
@ -86,10 +86,11 @@ const webhookDefinition: IAddonDefinition = {
|
||||
"event": "{{event.type}}",
|
||||
"createdBy": "{{event.createdBy}}",
|
||||
"featureToggle": "{{event.data.name}}",
|
||||
"timestamp": "{{event.data.createdAt}}"
|
||||
"timestamp": "{{event.data.createdAt}}",
|
||||
"json": {{{eventJson}}}
|
||||
}`,
|
||||
description:
|
||||
"(Optional) You may format the body using a mustache template. If you don't specify anything, the format will similar to the events format (https://docs.getunleash.io/reference/api/legacy/unleash/admin/events)",
|
||||
"(Optional) You may format the body using a mustache template. If you don't specify anything, the format will similar to the events format (https://docs.getunleash.io/reference/api/legacy/unleash/admin/events). You can use {{{eventJson}}} to include entire serialized event.",
|
||||
type: 'textfield',
|
||||
required: false,
|
||||
sensitive: false,
|
||||
|
@ -22,6 +22,8 @@ export default class Webhook extends Addon {
|
||||
parameters;
|
||||
const context = {
|
||||
event,
|
||||
// Stringify twice to avoid escaping in Mustache
|
||||
eventJson: JSON.stringify(JSON.stringify(event)),
|
||||
};
|
||||
|
||||
let body: string | undefined;
|
||||
|
Loading…
Reference in New Issue
Block a user