export type SendEmailArguments = { from?: string; to: string; subject: string; body?: string; template: string; data: EmailData; [key: string]: unknown; }; /** * Validates email arguments to ensure they meet the required format. * @param args - The arguments to validate * @throws Will throw an error if validation fails */ export declare function validateSendEmailArguments(args: unknown): asserts args is SendEmailArguments; export interface EmailService { sendEmail: (args: SendEmailArguments) => Promise; } /** * Retrieves the registered email service from the registry. * @returns The email service object. */ export declare function getEmailService(): EmailService | undefined; /** Registers a new email service. * @param service - The email service to register. * @throws Will throw an error if the service does not implement the EmailService interface. */ export declare function registerEmailService(service: EmailService): void; /** * Sends an email using the registered email service. * @param id - The identifier for the email type, e.g., 'order_confirmation' * @param args - The email arguments * @returns A promise that resolves when the email is sent. */ export declare function sendEmail(id: string, args: SendEmailArguments): Promise; export interface EmailData { storeInfo?: { logo?: { src?: string; alt?: string; height?: string; width?: string; }; storeName: string; storeEmail: string; storeDescription: string; phone: string; homeUrl: string; address: { country?: string; province?: string; city?: string; street?: string; postalCode?: string; }; }; [key: string]: unknown; } /** * Builds email body from a template by replacing placeholders with actual data. * @param template - The email template string with placeholders in {{key}} format. * @param data - An object containing key-value pairs to replace in the template. * @returns The final email body string with placeholders replaced by actual data. */ export declare function buildEmailBodyFromTemplate(template: string, data: EmailData): Promise;