fix: variables for custom webhook payload (#11135)

Co-authored-by: CarinaWolli <wollencarina@gmail.com>
pull/11139/head
Carina Wollendorfer 2023-09-04 14:01:12 -04:00 committed by GitHub
parent 3c5901edb8
commit 13f9e97015
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 5 deletions

View File

@ -77,11 +77,7 @@ function getZapierPayload(
}
function applyTemplate(template: string, data: WebhookDataType, contentType: ContentType) {
const organizer = JSON.stringify(data.organizer);
const attendees = JSON.stringify(data.attendees);
const formattedData = { ...data, metadata: JSON.stringify(data.metadata), organizer, attendees };
const compiled = compile(template)(formattedData).replace(/&quot;/g, '"');
const compiled = compile(template)(data).replace(/&quot;/g, '"');
if (contentType === "application/json") {
return JSON.stringify(jsonParse(compiled));