Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions apps/sim/executor/utils/start-block.ts
Original file line number Diff line number Diff line change
Expand Up @@ -377,10 +377,7 @@ function buildManualTriggerOutput(
return mergeFilesIntoOutput(output, workflowInput)
}

function buildIntegrationTriggerOutput(
_finalInput: unknown,
workflowInput: unknown
): NormalizedBlockOutput {
function buildIntegrationTriggerOutput(workflowInput: unknown): NormalizedBlockOutput {
return isPlainObject(workflowInput) ? (workflowInput as NormalizedBlockOutput) : {}
}

Expand Down Expand Up @@ -430,7 +427,7 @@ export function buildStartBlockOutput(options: StartBlockOutputOptions): Normali
return buildManualTriggerOutput(finalInput, workflowInput)

case StartBlockPath.EXTERNAL_TRIGGER:
return buildIntegrationTriggerOutput(finalInput, workflowInput)
return buildIntegrationTriggerOutput(workflowInput)

case StartBlockPath.LEGACY_STARTER:
return buildLegacyStarterOutput(
Expand Down
22 changes: 22 additions & 0 deletions apps/sim/lib/webhooks/imap-polling-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,17 @@ export interface SimplifiedImapEmail {
}

export interface ImapWebhookPayload {
messageId: string
subject: string
from: string
to: string
cc: string
date: string | null
bodyText: string
bodyHtml: string
mailbox: string
hasAttachments: boolean
attachments: ImapAttachment[]
email: SimplifiedImapEmail
timestamp: string
}
Expand Down Expand Up @@ -613,6 +624,17 @@ async function processEmails(
}

const payload: ImapWebhookPayload = {
messageId: simplifiedEmail.messageId,
subject: simplifiedEmail.subject,
from: simplifiedEmail.from,
to: simplifiedEmail.to,
cc: simplifiedEmail.cc,
date: simplifiedEmail.date,
bodyText: simplifiedEmail.bodyText,
bodyHtml: simplifiedEmail.bodyHtml,
mailbox: simplifiedEmail.mailbox,
hasAttachments: simplifiedEmail.hasAttachments,
attachments: simplifiedEmail.attachments,
email: simplifiedEmail,
timestamp: new Date().toISOString(),
}
Expand Down
6 changes: 6 additions & 0 deletions apps/sim/lib/webhooks/rss-polling-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ interface RssFeed {
}

export interface RssWebhookPayload {
title?: string
link?: string
pubDate?: string
item: RssItem
feed: {
title?: string
Expand Down Expand Up @@ -349,6 +352,9 @@ async function processRssItems(
`${webhookData.id}:${itemGuid}`,
async () => {
const payload: RssWebhookPayload = {
title: item.title,
link: item.link,
pubDate: item.pubDate,
item: {
title: item.title,
link: item.link,
Expand Down
14 changes: 14 additions & 0 deletions apps/sim/lib/webhooks/utils.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,9 @@ export async function formatWebhookInput(
if (foundWebhook.provider === 'rss') {
if (body && typeof body === 'object' && 'item' in body) {
return {
title: body.title,
link: body.link,
pubDate: body.pubDate,
item: body.item,
feed: body.feed,
timestamp: body.timestamp,
Expand All @@ -697,6 +700,17 @@ export async function formatWebhookInput(
if (foundWebhook.provider === 'imap') {
if (body && typeof body === 'object' && 'email' in body) {
return {
messageId: body.messageId,
subject: body.subject,
from: body.from,
to: body.to,
cc: body.cc,
date: body.date,
bodyText: body.bodyText,
bodyHtml: body.bodyHtml,
mailbox: body.mailbox,
hasAttachments: body.hasAttachments,
attachments: body.attachments,
email: body.email,
timestamp: body.timestamp,
}
Expand Down