65 lines
2.2 KiB
TypeScript
65 lines
2.2 KiB
TypeScript
export interface EmailOptions {
|
|
to: string;
|
|
subject: string;
|
|
html?: string;
|
|
text?: string;
|
|
template?: string;
|
|
templateData?: any;
|
|
}
|
|
export interface EmailConfig {
|
|
host: string;
|
|
port: number;
|
|
secure: boolean;
|
|
auth: {
|
|
user: string;
|
|
pass: string;
|
|
};
|
|
from: string;
|
|
}
|
|
export declare class EmailService {
|
|
private transporter;
|
|
private config;
|
|
private templatesPath;
|
|
constructor();
|
|
private initializeTransporter;
|
|
/**
|
|
* Send email with template
|
|
* @param options - Email options including template and data
|
|
*/
|
|
sendEmail(options: EmailOptions): Promise<boolean>;
|
|
/**
|
|
* Send verification email to user
|
|
* @param userEmail - User's email address
|
|
* @param userName - User's name
|
|
* @param verificationToken - Verification token
|
|
* @param verificationUrl - Complete verification URL
|
|
* @param language - Language code ('en', 'hu', 'de')
|
|
*/
|
|
sendVerificationEmail(userEmail: string, userName: string, verificationToken: string, verificationUrl: string, language?: 'en' | 'hu' | 'de'): Promise<boolean>;
|
|
/**
|
|
* Send password reset email
|
|
* @param userEmail - User's email address
|
|
* @param userName - User's name
|
|
* @param resetToken - Password reset token
|
|
* @param resetUrl - Complete password reset URL
|
|
* @param language - Language code ('en', 'hu', 'de')
|
|
*/
|
|
sendPasswordResetEmail(userEmail: string, userName: string, resetToken: string, resetUrl: string, language?: 'en' | 'hu' | 'de'): Promise<boolean>;
|
|
/**
|
|
* Load and compile email template with language support
|
|
* @param templateName - Name of the template file (with or without language suffix)
|
|
* @param data - Data to replace placeholders in the template
|
|
*/
|
|
private loadTemplate;
|
|
/**
|
|
* Get localized verification email subject
|
|
* @param language - Language code ('en', 'hu', 'de')
|
|
*/
|
|
private getLocalizedVerificationSubject;
|
|
/**
|
|
* Get localized password reset email subject
|
|
* @param language - Language code ('en', 'hu', 'de')
|
|
*/
|
|
private getLocalizedPasswordResetSubject;
|
|
}
|
|
//# sourceMappingURL=EmailService.d.ts.map
|