actually start on mailing, fix email regex
Some checks failed
Code quality checks / biome (push) Failing after 22s

This commit is contained in:
creations 2025-06-10 16:34:15 -04:00
parent 00a7417936
commit 86be889ede
Signed by: creations
GPG key ID: 8F553AA4320FC711
17 changed files with 349 additions and 32 deletions

View file

@ -1 +1,2 @@
export * from "./validation";
export * from "./mailer";

45
types/lib/mailer.ts Normal file
View file

@ -0,0 +1,45 @@
import type { Attachment } from "nodemailer/lib/mailer";
interface TemplateVariables {
[key: string]: string | number | boolean;
}
interface SendMailOptions {
to: string | string[];
subject: string;
cc?: string | string[];
bcc?: string | string[];
from?: string;
replyTo?: string;
template?: string;
templateVariables?: TemplateVariables;
html?: string;
text?: string;
attachments?: Attachment[];
priority?: "high" | "normal" | "low";
headers?: Record<string, string>;
}
type MailerConfig = {
address: string;
port: number;
from: string;
username: string;
password: string;
secure: boolean;
pool: boolean;
connectionTimeout: number;
socketTimeout: number;
maxConnections: number;
maxMessages: number;
replyTo: string;
};
type EmailResult = {
success: boolean;
messageId?: string;
response?: string;
error?: string;
};
export type { TemplateVariables, SendMailOptions, MailerConfig, EmailResult };