import { APIResource } from "../../core/resource.js"; import * as SubdomainsAPI from "./subdomains/subdomains.js"; import { BaseSubdomains, SubdomainCreateParams, SubdomainCreateResponse, SubdomainDeleteParams, SubdomainDeleteResponse, SubdomainGetParams, SubdomainGetResponse, SubdomainListParams, SubdomainListResponse, SubdomainListResponsesSinglePage, Subdomains } from "./subdomains/subdomains.js"; import { APIPromise } from "../../core/api-promise.js"; import { RequestOptions } from "../../internal/request-options.js"; export declare class BaseEmailSending extends APIResource { static readonly _key: readonly ['emailSending']; /** * Send an email * * @example * ```ts * const response = await client.emailSending.send({ * account_id: 'account_id', * from: 'sender@example.com', * subject: 'Monthly Report', * }); * ``` */ send(params: EmailSendingSendParams, options?: RequestOptions): APIPromise; /** * Send a raw MIME email * * @example * ```ts * const response = await client.emailSending.sendRaw({ * account_id: 'account_id', * from: 'sender@example.com', * mime_message: * 'From: sender@example.com\r\nTo: recipient@example.com\r\nSubject: Hello\r\nContent-Type: text/plain\r\n\r\nHello, World!', * recipients: ['recipient@example.com'], * }); * ``` */ sendRaw(params: EmailSendingSendRawParams, options?: RequestOptions): APIPromise; } export declare class EmailSending extends BaseEmailSending { subdomains: SubdomainsAPI.Subdomains; } export interface EmailSendingSendResponse { /** * Email addresses to which the message was delivered immediately. */ delivered: Array; /** * Message ID of the sent email. */ message_id: string; /** * Email addresses that permanently bounced. */ permanent_bounces: Array; /** * Email addresses for which delivery was queued for later. */ queued: Array; } export interface EmailSendingSendRawResponse { /** * Email addresses to which the message was delivered immediately. */ delivered: Array; /** * Message ID of the sent email. */ message_id: string; /** * Email addresses that permanently bounced. */ permanent_bounces: Array; /** * Email addresses for which delivery was queued for later. */ queued: Array; } export interface EmailSendingSendParams { /** * Path param: Identifier of the account. */ account_id: string; /** * Body param: Sender email address. Either a plain string or an object with * address and name. */ from: string | EmailSendingSendParams.EmailSendingEmailAddressObject; /** * Body param: Email subject line. */ subject: string; /** * Body param: File attachments and inline images. */ attachments?: Array; /** * Body param: BCC recipient(s). A single email string or an array of email * strings. */ bcc?: string | Array; /** * Body param: CC recipient(s). A single email string or an array of email strings. */ cc?: string | Array; /** * Body param: Custom email headers as key-value pairs. */ headers?: { [key: string]: string; }; /** * Body param: HTML body of the email. At least one of text or html must be * provided (non-empty). */ html?: string; /** * Body param: Reply-to address. Either a plain string or an object with address * and name. */ reply_to?: string | EmailSendingSendParams.EmailSendingEmailAddressObject; /** * Body param: Plain text body of the email. At least one of text or html must be * provided (non-empty). */ text?: string; /** * Body param: Recipient(s). Optional if cc or bcc is provided. A single email * string or an array of email strings. */ to?: string | Array; } export declare namespace EmailSendingSendParams { interface EmailSendingEmailAddressObject { /** * Email address (e.g., 'user@example.com'). */ address: string; /** * Display name for the email address (e.g., 'John Doe'). */ name: string; } interface EmailSendingEmailInlineAttachment { /** * Base64-encoded content of the attachment. */ content: string; /** * Content ID used to reference this attachment in HTML via cid: URI (e.g., * ). */ content_id: string; /** * Must be 'inline'. Indicates the attachment is embedded in the email body. */ disposition: 'inline'; /** * Filename for the attachment. */ filename: string; /** * MIME type of the attachment (e.g., 'image/png', 'text/plain'). */ type: string; } interface EmailSendingEmailAttachment { /** * Base64-encoded content of the attachment. */ content: string; /** * Must be 'attachment'. Indicates a standard file attachment. */ disposition: 'attachment'; /** * Filename for the attachment. */ filename: string; /** * MIME type of the attachment (e.g., 'application/pdf', 'text/plain'). */ type: string; } interface EmailSendingEmailAddressObject { /** * Email address (e.g., 'user@example.com'). */ address: string; /** * Display name for the email address (e.g., 'John Doe'). */ name: string; } } export interface EmailSendingSendRawParams { /** * Path param: Identifier of the account. */ account_id: string; /** * Body param: Sender email address. */ from: string; /** * Body param: The full MIME-encoded email message. Should include standard RFC * 5322 headers such as From, To, Subject, and Content-Type. The from and * recipients fields in the request body control SMTP envelope routing; the From * and To headers in the MIME message control what the recipient's email client * displays. */ mime_message: string; /** * Body param: List of recipient email addresses. */ recipients: Array; } export declare namespace EmailSending { export { type EmailSendingSendResponse as EmailSendingSendResponse, type EmailSendingSendRawResponse as EmailSendingSendRawResponse, type EmailSendingSendParams as EmailSendingSendParams, type EmailSendingSendRawParams as EmailSendingSendRawParams, }; export { Subdomains as Subdomains, BaseSubdomains as BaseSubdomains, type SubdomainCreateResponse as SubdomainCreateResponse, type SubdomainListResponse as SubdomainListResponse, type SubdomainDeleteResponse as SubdomainDeleteResponse, type SubdomainGetResponse as SubdomainGetResponse, type SubdomainListResponsesSinglePage as SubdomainListResponsesSinglePage, type SubdomainCreateParams as SubdomainCreateParams, type SubdomainListParams as SubdomainListParams, type SubdomainDeleteParams as SubdomainDeleteParams, type SubdomainGetParams as SubdomainGetParams, }; } //# sourceMappingURL=email-sending.d.ts.map