UNPKG

@454creative/easy-email

Version:

A framework-agnostic email service library for Node.js with observability and monitoring

43 lines (36 loc) 859 B
import { EmailProviderType } from '../types'; export interface ITemplateService { renderTemplate( templateId: string, data: Record<string, any>, provider: EmailProviderType ): Promise<string>; validateTemplate( templateId: string, provider: EmailProviderType ): Promise<boolean>; getTemplateInfo( templateId: string, provider: EmailProviderType ): Promise<TemplateInfo>; } export interface TemplateInfo { id: string; name: string; version: string; variables: string[]; lastModified: Date; provider: EmailProviderType; } export interface TemplateRenderOptions { locale?: string; version?: string; fallbackToCustom?: boolean; } export interface TemplateValidationResult { isValid: boolean; errors: string[]; warnings: string[]; variables: string[]; missingVariables: string[]; }