(emailConfig: EmailConfig)
| 30 | } |
| 31 | |
| 32 | export function createMicroServiceWrapper(emailConfig: EmailConfig): MicroServiceWrapper { |
| 33 | const microService = new MicroService(emailConfig); |
| 34 | |
| 35 | return { |
| 36 | async sendMail(message: EmailMessage): Promise<EmailServiceResponse> { |
| 37 | return microService.sendMail(message); |
| 38 | }, |
| 39 | |
| 40 | async sendWelcomeEmail( |
| 41 | to: string | string[], |
| 42 | userName: string, |
| 43 | serviceName?: string |
| 44 | ): Promise<EmailServiceResponse> { |
| 45 | return microService.sendWelcomeEmail(to, userName, serviceName); |
| 46 | }, |
| 47 | |
| 48 | async sendPasswordResetEmail( |
| 49 | to: string | string[], |
| 50 | userName: string, |
| 51 | resetLink: string, |
| 52 | serviceName?: string, |
| 53 | expiryTime?: string |
| 54 | ): Promise<EmailServiceResponse> { |
| 55 | return microService.sendPasswordResetEmail(to, userName, resetLink, serviceName, expiryTime); |
| 56 | }, |
| 57 | |
| 58 | async sendNotificationEmail( |
| 59 | to: string | string[], |
| 60 | title: string, |
| 61 | message: string, |
| 62 | serviceName?: string |
| 63 | ): Promise<EmailServiceResponse> { |
| 64 | return microService.sendNotificationEmail(to, title, message, serviceName); |
| 65 | }, |
| 66 | |
| 67 | async verifyConnection(): Promise<boolean> { |
| 68 | return microService.verifyEmailConnection(); |
| 69 | }, |
| 70 | |
| 71 | getTemplates(): Record<string, any> { |
| 72 | return microService.getTemplates(); |
| 73 | }, |
| 74 | }; |
| 75 | } |
| 76 | |
| 77 | // Export types for external use |
| 78 | export type { EmailConfig, EmailMessage, EmailServiceResponse } from './types/index.js'; |
no outgoing calls
no test coverage detected