export declare const emailLogStore: import("../db/store-registry.js").Store; export declare function ensureTable(): Promise; export interface RecordEmailSendArgs { orgId?: string | null; templateId?: string; app?: string; recipient: string; sender: string; subject: string; status: "sent" | "failed" | "suppressed"; error?: string; provider: string; requestPayload?: string; responseStatus?: number; responseBody?: string; htmlBody?: string; textBody?: string; } export declare function recordEmailSend(args: RecordEmailSendArgs): Promise; export interface EmailSendStats { templateId: string; sent: number; failed: number; lastSentAt: number | null; } export declare function getEmailSendStats(since: number, app: string, orgId: string): Promise; export interface EmailLogEntry { id: string; templateId: string | null; app: string | null; recipient: string; sender: string; subject: string; status: string; error: string | null; provider: string; requestPayload: string | null; responseStatus: number | null; responseBody: string | null; createdAt: number; } export interface ListEmailLogFilters { orgId: string; app: string; templateId?: string; excludeTemplateIds?: string[]; to?: string; excludeTo?: string; from?: string; excludeFrom?: string; status?: "sent" | "failed" | "suppressed"; provider?: string; sinceMs?: number; untilMs?: number; limit?: number; offset?: number; } export declare function listEmailLog(options: ListEmailLogFilters): Promise; export interface EmailLogEntryBody { htmlBody: string | null; textBody: string | null; } /** * Fetch the redacted-at-write body for one send-log row, scoped to the same * org/app the list view is scoped to so a guessed `id` from another * organization or app can't be used to read a body cross-tenant. Returns * `null` when the row doesn't exist or isn't visible in that scope — distinct * from a row that exists but never had a body recorded (both `htmlBody` and * `textBody` `null` on the returned object). */ export declare function getEmailLogEntryBody(options: { orgId: string; app: string; id: string; }): Promise; export declare function getScopedEmailProviderCategory(templateId: string, orgId: string): string;