webhook.onSyncRequired
Events may have been missed — run a sync to replay the gap.
Fires when emailkit detects that events may have been missed — notifications were dropped or the provider reports a history gap (reason says which). Run a sync for the affected scope to replay what was missed through the same hooks.
hooks: {
webhook: {
onSyncRequired: async (event) => {
await jobs.enqueue("emailkit-sync", {
emailDriver: event.emailDriver,
scope: event.scope,
target: event.target,
});
},
},
},
Payload
PropType
id?string
Type
stringemailDriverstring
Type
stringactionWebhookLifecycleAction
Type
WebhookLifecycleActionsourceWebhookLifecycleSource
Type
WebhookLifecycleSourcereasonWebhookLifecycleReason
Type
WebhookLifecycleReasonrecommendedActions?WebhookRecommendedAction[]
Type
WebhookRecommendedAction[]scopeWebhookScope
Type
WebhookScopewebhook?Webhook
Type
WebhookpreviousWebhook?Webhook
Type
WebhookwebhookId?string
Type
stringproviderId?string
Type
stringsubscriptionId?string
Type
stringtarget?WebhookLifecycleTarget
Type
WebhookLifecycleTargetstatus?WebhookStatus
Type
WebhookStatuspreviousStatus?WebhookStatus
Type
WebhookStatusexpiresAt?Date
Type
DaterenewAfter?Date
Type
DatereceivedAt?Date
Type
Dateseverity?"info" | "warning" | "critical"
Type
"info" | "warning" | "critical"context?unknown
Type
unknownraw?unknown
Type
unknown