/** * Email Send API Route Handler for Next.js * * Sends a raw email through the default (or specified) provider. * Re-export in your Next.js application at /api/email/send. * * @example * ```typescript * // app/api/email/send/route.ts * export { POST } from 'nextly/api/email-send'; * ``` * * The service returns `{ success, messageId? }`; the `messageId` is the * useful caller-facing field, paired with a server-authored toast via * `respondAction`. The attachment resolver throws `NextlyError` directly * (validation for caller-fixable failures, internal for storage I/O); the * machine-readable `EMAIL_ATTACHMENT_*` code lives at * `error.data.errors[0].code`. * * @module api/email-send */ /** * POST handler for sending a raw email. * * Request body: * - `to` (string, required): Recipient email address * - `subject` (string, required) * - `html` (string, required) * - `plainText` (string, optional) * - `cc` / `bcc` (string[], optional) * - `providerId` (string, optional): use a specific email provider * - `attachments` (array, optional): `[{ mediaId, filename? }]` * * Response codes: * - 200 OK: `{ message, success, messageId? }` via `respondAction`. * - 400 Bad Request: invalid body / attachment count or size exceeded / mediaId not found. * - 401 Unauthorized. * - 500 Internal Server Error: storage read failed or provider error. */ declare const POST: (request: Request) => Promise; export { POST };