Digest Notifications
Implement notification digests with Enbbox. Reduce notification fatigue by batching multiple events into periodic summary notifications.
Digest notifications combine multiple events into a single notification, reducing noise and improving user experience.
Example: Comment Digest
Instead of sending a notification for every comment, batch them:
const commentDigest = workflow("comment-digest", async ({ step, payload }) => {
const digest = await step.digest("batch-comments", async () => ({
amount: 30,
unit: "minutes",
}));
await step.email("digest-email", async () => ({
subject: `${digest.events.length} new comments on your post`,
body: `
<h2>New Comments</h2>
${digest.events
.map(
(e) => `
<div>
<strong>${e.payload.author}</strong>: ${e.payload.comment}
</div>
`,
)
.join("")}
`,
}));
await step.inApp("digest-inapp", async () => ({
subject: `${digest.events.length} new comments`,
body: `You have ${digest.events.length} new comments on "${payload.postTitle}"`,
}));
});How Digests Work
- First trigger starts the digest window (e.g., 30 minutes)
- Additional triggers within the window are collected
- When the window expires, the next step receives all collected events
- The notification is sent once with aggregated data
Use Cases
- Comment notifications — Batch per post
- Activity summaries — Daily/hourly digests
- Team updates — Combine multiple changes
- Alert batching — Group related alerts
In-App Notifications
Add a real-time notification inbox to your React, Next.js or web application in under 5 minutes. Drop-in Inbox component with customizable theming, bell icons, and event handling.
Multi-Channel Workflows
Build multi-channel notification workflows with Enbbox. Combine email, SMS, push, in-app, and chat channels in a single workflow with fallback logic and conditional routing.