Skip to content

Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.

feat: add EMAIL_NOTIFICATIONS feature plan and update notify function payload type

naveenkashe91e33c22713
diff --git a/packages/ee/src/plan.ts b/packages/ee/src/plan.ts
index 6326c63923..33ff629259 100644
--- a/packages/ee/src/plan.ts
+++ b/packages/ee/src/plan.ts
@@ -10,7 +10,8 @@ export const FEATURE_PLANS = {
WEBHOOKS: [Plan.Business, Plan.Partner],
INTEGRATIONS: [Plan.Business, Plan.Partner],
ITEM_RULES: [Plan.Business],
- AUDIT_LOG: [Plan.Business]
+ AUDIT_LOG: [Plan.Business],
+ EMAIL_NOTIFICATIONS: [Plan.Business]
} as const satisfies Record<string, Plan[]>;
export type Feature = keyof typeof FEATURE_PLANS;
diff --git a/packages/jobs/src/inngest/functions/notifications/notify.ts b/packages/jobs/src/inngest/functions/notifications/notify.ts
index 0e553e7859..74258dd0fd 100644
--- a/packages/jobs/src/inngest/functions/notifications/notify.ts
+++ b/packages/jobs/src/inngest/functions/notifications/notify.ts
@@ -7,6 +7,7 @@ import {
} from "@carbon/ee/notifications";
import { companyHasPlan } from "@carbon/ee/plan.server";
import { ERP_URL } from "@carbon/env";
+import type { Events } from "@carbon/lib/events";
import {
getNotificationEmailCtaLabel,
getNotificationEmailHeading,
@@ -476,7 +477,7 @@ export const notifyFunction = inngest.createFunction(
},
{ event: "carbon/notify" },
async ({ event, step }) => {
- const payload = event.data;
+ const payload = event.data as Events["carbon/notify"]["data"];
// inApp is always on so the topbar reflects every notification. Callers
// can request additional channels (email, slack) but cannot opt out of
// the in-app row.