// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../core/resource'; import { APIPromise } from '../core/api-promise'; import { RequestOptions } from '../internal/request-options'; /** * Send emails via AWS SES. */ export class Email extends APIResource { /** * Send an email via AWS SES. * * This is a fire-and-forget endpoint — the email is sent but not persisted to any * database or thread. */ send(body: EmailSendParams, options?: RequestOptions): APIPromise { return this._client.post('/email/send', { body, ...options }); } } /** * Response returned after successfully sending an email. */ export interface EmailSendResponse { /** * The AWS SES message ID for tracking. */ ses_message_id: string; } export interface EmailSendParams { /** * Plain-text email body. */ body: string; /** * Email subject line. */ subject: string; /** * List of recipient email addresses. */ to: Array; /** * Attachments to include with the email. */ attachments?: Array; /** * List of BCC email addresses. */ bcc?: Array; /** * List of CC email addresses. */ cc?: Array; /** * Display name for the sender. Defaults to "Village". */ from_name?: string | null; /** * HTML email body. */ html_body?: string | null; } export namespace EmailSendParams { /** * Attachment payload for a send-email request. */ export interface Attachment { /** * Base64-encoded attachment bytes. */ content_base64: string; /** * MIME content type for the attachment, such as image/png. */ content_type: string; /** * Filename to present in the email client. */ filename: string; /** * Required for inline attachments; reference from HTML as cid:. */ content_id?: string | null; /** * Whether the attachment should be inline or downloadable. */ disposition?: 'inline' | 'attachment'; } } export declare namespace Email { export { type EmailSendResponse as EmailSendResponse, type EmailSendParams as EmailSendParams }; }