import { SendMailOptions, Transporter } from "nodemailer"; /** * Defines the options for sending an email. */ export type EmailOptions = { subject: string; } & SendMailOptions; /** * Defines the authentication options for SMTP. */ export type SMTPAuthOptions = { user: string; pass: string; }; /** * Defines the connection options for SMTP server. */ export type SMTPConnectionOptions = { host?: string; port?: number; secure?: boolean; auth?: SMTPAuthOptions; name?: string; user?: string; pass?: string; }; /** * A service class to handle email-related tasks, including sending emails. * * See the api reference [www.arkosjs.com/docs/reference/the-email-service-class](https://www.arkosjs.com/docs/reference/the-email-service-class) */ export declare class EmailService { transporter: Transporter | null; private customConfig; /** * Creates an instance of the EmailService class. * * @param {SMTPConnectionOptions} [config] - Optional custom SMTP configuration. * If provided, these settings will be used instead of the Arkos config. */ constructor(config?: SMTPConnectionOptions); /** * Gets the email configuration from multiple sources with priority: * 1. Constructor customConfig * 2. ArkosConfig * 3. Environment variables * @returns Configuration object with host, port, and auth details * @throws AppError if required email configuration is not set */ private getEmailConfig; /** * Gets or creates a transporter using the email configuration * @param customConfig Optional override connection settings (takes full priority if provided) * @returns A configured nodemailer transporter */ private getTransporter; /** * Sends an email with the provided options. * Can use either the default configuration or custom connection options. * * @param {EmailOptions} options - The options for the email to be sent. * @param {SMTPConnectionOptions} [connectionOptions] - Optional custom connection settings. * @param {boolean} [skipVerification=false] - Whether to skip connection verification. * @returns {Promise<{ success: boolean; messageId?: string } & Record>} Result with message ID on success. */ send(options: EmailOptions & SendMailOptions, connectionOptions?: SMTPConnectionOptions, skipVerification?: boolean): Promise<{ success: boolean; messageId?: string; } & Record>; /** * Verifies the connection to the email server. * @param {Transporter} [transporterToVerify] - Optional transporter to verify. * @returns {Promise} A promise that resolves to true if connection is valid. */ verifyConnection(transporterToVerify?: Transporter): Promise; /** * Updates the custom configuration for this email service instance. * @param {SMTPConnectionOptions} config - The new connection options. */ updateConfig(config: SMTPConnectionOptions): void; /** * Creates a new instance of EmailService with custom configuration. * @param {SMTPConnectionOptions} config - The connection options for the new instance. * @returns {EmailService} A new EmailService instance. */ static create(config: SMTPConnectionOptions): EmailService; } declare const emailService: EmailService; export default emailService;