added event trigger to discord payload (#2109)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
parent
eaf19d1d23
commit
c9fb82a7e6
2 changed files with 3 additions and 2 deletions
|
@ -21,7 +21,7 @@ const customTemplate = (props: WebhookIntegrationProps) => {
|
||||||
const integrationTemplate = (webhookIntegration: string) => {
|
const integrationTemplate = (webhookIntegration: string) => {
|
||||||
switch (webhookIntegration) {
|
switch (webhookIntegration) {
|
||||||
case "https://discord.com/api/webhooks/":
|
case "https://discord.com/api/webhooks/":
|
||||||
return '{"content": "A new event has been scheduled","embeds": [{"color": 2697513,"fields": [{"name": "What","value": "{{title}} ({{type}})"},{"name": "When","value": "Start: {{startTime}} \\n End: {{endTime}} \\n Timezone: ({{organizer.timeZone}})"},{"name": "Who","value": "Organizer: {{organizer.name}} ({{organizer.email}}) \\n Booker: {{attendees.0.name}} ({{attendees.0.email}})" },{"name":"Description", "value":": {{description}}"},{"name":"Where","value":": {{location}} "}]}]}';
|
return '{"content": "An event has been scheduled/updated","embeds": [{"color": 2697513,"fields": [{"name": "Event Trigger","value": "{{triggerEvent}}"}, {"name": "What","value": "{{title}} ({{type}})"},{"name": "When","value": "Start: {{startTime}} \\n End: {{endTime}} \\n Timezone: ({{organizer.timeZone}})"},{"name": "Who","value": "Organizer: {{organizer.name}} ({{organizer.email}}) \\n Booker: {{attendees.0.name}} ({{attendees.0.email}})" },{"name":"Description", "value":": {{description}}"},{"name":"Where","value":": {{location}} "}]}]}';
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -146,6 +146,7 @@ export const webhookRouter = createProtectedRouter()
|
||||||
};
|
};
|
||||||
|
|
||||||
const data = {
|
const data = {
|
||||||
|
triggerEvent: "PING",
|
||||||
type: "Test",
|
type: "Test",
|
||||||
title: "Test trigger event",
|
title: "Test trigger event",
|
||||||
description: "",
|
description: "",
|
||||||
|
@ -161,7 +162,7 @@ export const webhookRouter = createProtectedRouter()
|
||||||
],
|
],
|
||||||
organizer: {
|
organizer: {
|
||||||
name: "Cal",
|
name: "Cal",
|
||||||
email: "",
|
email: "no-reply@cal.com",
|
||||||
timeZone: "Europe/London",
|
timeZone: "Europe/London",
|
||||||
language,
|
language,
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue