import type { MailOptions, TenantTransporter } from '../types/index.js';
declare class MailService {
    private senders;
    private tenantTransporters;
    private defaultSender;
    private engine;
    private defaultLayoutTemplate;
    private defaultLayoutTemplatePath;
    private defaultLogoPath;
    private customLogoPath;
    private logoDataUri;
    private initialized;
    constructor();
    initialize(): Promise<void>;
    getSendersEnabled(): string[];
    initializeSender(sender: string): Promise<void>;
    loadDefaultLayoutTemplate(): void;
    loadLogo(): void;
    /**
     * Get template from database with tenant-specific override support
     */
    getTemplateFromDB(templateName: string, tenantId?: string | number): Promise<{
        subject: string;
        body: string;
    } | null>;
    /**
     * Wrap body content in a minimal HTML document structure if it's not already a complete document.
     */
    private wrapInHtmlDocument;
    /**
     * Escape HTML special characters for safe insertion into HTML attributes/content
     */
    private escapeHtml;
    /**
     * Render template from database
     * First tries database, then falls back to hardcoded default templates
     *
     * NOTE: Templates are wrapped in the default layout only if they don't have HTML/body structure.
     * Templates with full HTML structure have full control over their layout.
     */
    renderTemplateWithDB(templateName: string, context: Record<string, any>, tenantId?: string | number): Promise<{
        subject: string;
        html: string;
    }>;
    /**
     * Wrap content with default layout template if it doesn't already have HTML/body structure
     */
    private wrapWithLayoutIfNeeded;
    renderTemplate(templateName: string, context: Record<string, any>): Promise<string>;
    /**
     * Get default template content for a given type
     * These are the built-in templates that are seeded into the database
     */
    getDefaultTemplateContent(templateType: string): {
        subject: string;
        body: string;
        description: string;
    } | null;
    /**
     * Get all available default template types
     */
    getDefaultTemplateTypes(): Array<{
        type: string;
        label: string;
        description: string;
        variables: string[];
    }>;
    /**
     * Get common variables available in all templates
     */
    getCommonVariables(): string[];
    /**
     * Get or create tenant-specific transporter
     */
    getTenantTransporter(tenantId: string | number): Promise<TenantTransporter | null>;
    /**
     * Invalidate tenant transporter cache
     */
    invalidateTenantTransporter(tenantId?: string | number): void;
    sendMail(options: MailOptions): Promise<any>;
    /**
     * Log email to database asynchronously (fire and forget)
     */
    private logEmail;
}
declare global {
    var __baasix_mailService: MailService | undefined;
}
declare const mailService: MailService;
export default mailService;
//# sourceMappingURL=MailService.d.ts.map