interface SendEmailOptions { to: string; subject: string; replyTo?: string; html: string; text: string; } interface SendEmailResult { success: boolean; messageId?: string; testMode: boolean; } interface SendCampaignEmailOptions { recipientEmail: string; recipientName?: string; recipientLevel?: string; userEmail: string; userName: string; postalCode: string; subject: string; message: string; campaignTitle: string; } declare class EmailService { private transporter; constructor(); private createTransporter; /** Rebuild transporter from DB settings (with env fallback). Call after SMTP settings change. */ rebuildTransporter(): Promise; testConnection(): Promise; /** * Load template from database (with caching) */ private loadTemplateFromDatabase; /** * Load template - checks database first, falls back to filesystem * @param name Template key (e.g., "campaign-email") * @param type File type (html or txt) - only used for filesystem fallback */ loadTemplate(name: string, type: 'html' | 'txt'): string; /** * Clear database template cache * @param key Optional specific template key to clear. If not provided, clears all. */ clearDatabaseCache(key?: string): void; escapeHtml(unsafe: string): string; /** * Fetch video metadata from Media API */ private getVideoMetadata; private formatDuration; private formatViewCount; processTemplate(template: string, vars: Record, variableDefinitions?: Array<{ key: string; type: string; videoId?: number; }>): Promise; /** * Process text template (for plain text emails) */ processTextTemplate(template: string, vars: Record, variableDefinitions?: Array<{ key: string; type: string; videoId?: number; }>): Promise; /** * Process subject line template * Same as processTemplate but without HTML escaping */ processSubject(subject: string, vars: Record): string; private getFromField; private getOrganizationName; private getEmailTestConfig; sendEmail(options: SendEmailOptions): Promise; sendCampaignEmail(options: SendCampaignEmailOptions): Promise; /** Check whether production SMTP is configured (not mailhog test mode) */ isSmtpConfigured(): Promise; sendVerificationEmail(options: { recipientEmail: string; recipientName: string; verificationUrl: string; }): Promise; sendPasswordResetEmail(options: { recipientEmail: string; recipientName: string; resetUrl: string; }): Promise; sendAccountApprovedEmail(options: { recipientEmail: string; recipientName: string; loginUrl: string; }): Promise; sendPendingApprovalNotification(options: { adminEmails: string[]; newUserEmail: string; newUserName: string; }): Promise; sendShiftSignupConfirmation(options: { recipientEmail: string; recipientName: string; shiftTitle: string; shiftDate: string; shiftTime: string; shiftLocation: string; isNewUser: boolean; tempPassword?: string; loginUrl: string; }): Promise; sendShiftDetailsEmail(options: { recipientEmail: string; recipientName: string; shiftTitle: string; shiftDate: string; shiftStartTime: string; shiftEndTime: string; shiftLocation: string; shiftDescription: string; currentVolunteers: number; maxVolunteers: number; shiftStatus: string; }): Promise; sendAdminShiftSignupAlert(options: { adminEmails: string[]; shiftTitle: string; shiftDate: string; volunteerName: string; volunteerEmail: string; signupSource: string; adminUrl: string; }): Promise; sendAdminShiftCancellationAlert(options: { adminEmails: string[]; shiftTitle: string; shiftDate: string; volunteerName: string; volunteerEmail: string; cancellationSource: string; adminUrl: string; }): Promise; sendAdminResponseSubmittedAlert(options: { adminEmails: string[]; campaignTitle: string; representativeName: string; responseType: string; submitterName: string; adminUrl: string; }): Promise; sendAdminSignRequestedAlert(options: { adminEmails: string[]; volunteerName: string; address: string; shiftTitle: string; signSize: string; adminUrl: string; }): Promise; sendVolunteerSessionSummary(options: { volunteerEmail: string; volunteerName: string; cutName: string; sessionDate: string; visitCount: number; durationMinutes: number; distanceKm: number; outcomeBreakdown: Record; }): Promise; sendVolunteerCancellationAck(options: { volunteerEmail: string; volunteerName: string; shiftTitle: string; shiftDate: string; shiftTime: string; signupUrl: string; }): Promise; sendVolunteerShiftThankYou(options: { volunteerEmail: string; volunteerName: string; shiftTitle: string; shiftDate: string; shiftTime: string; shiftLocation: string; signupUrl: string; }): Promise; sendVolunteerReengagement(options: { volunteerEmail: string; volunteerName: string; lastActivityDate: string; lastActivityType: string; signupUrl: string; }): Promise; sendResponseVerification(options: { recipientEmail: string; campaignTitle: string; responseType: string; responseText: string; submitterName: string; verificationUrl: string; reportUrl: string; }): Promise; sendProfileLinkEmail(options: { recipientEmail: string; recipientName: string; profileUrl: string; organizationName: string; extraNotes?: string; }): Promise; } export declare const emailService: EmailService; export {}; //# sourceMappingURL=email.service.d.ts.map