Gate and meter email group: enterprise license (self-host) + credits (cloud) (#22390)
Email group (marketing email) was gated only by the `IS_EMAIL_GROUP_ENABLED` feature flag with no server-side enforcement. This adds real gating, split by deployment: - **Self-hosted** (`IS_BILLING_ENABLED=false`): requires a valid Enterprise plan. - **Cloud** (billing enabled): metered by credits, mirroring the existing AI credit system. Priced on AWS SES cost ($0.10/1,000 outbound) × 3 margin = $0.30/1,000 (300 micro-credits/email). Pre-flight blocks sends when out of credits; each email is charged after SES accepts it, in the async send job — matching how AWS bills us (no refund on bounce). Enforcement is applied at every email group resolver, and denials surface as proper client errors through a dedicated GraphQL exception filter.
This commit is contained in:
+1
@@ -9,6 +9,7 @@ export enum UsageOperationType {
|
||||
CODE_EXECUTION = 'CODE_EXECUTION',
|
||||
WEB_SEARCH = 'WEB_SEARCH',
|
||||
CALL_RECORDING = 'CALL_RECORDING',
|
||||
EMAIL_SEND = 'EMAIL_SEND',
|
||||
}
|
||||
|
||||
registerEnumType(UsageOperationType, {
|
||||
|
||||
@@ -7,4 +7,5 @@ export enum UsageResourceType {
|
||||
STORAGE = 'STORAGE',
|
||||
API = 'API',
|
||||
LOGIC_FUNCTION = 'LOGIC_FUNCTION',
|
||||
EMAIL = 'EMAIL',
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user