42 lines
803 B
TypeScript
42 lines
803 B
TypeScript
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 EmailOptions = {
|
|
to: string | string[];
|
|
subject: string;
|
|
text?: string;
|
|
html?: string;
|
|
from?: string;
|
|
replyTo?: string;
|
|
cc?: string | string[];
|
|
bcc?: string | string[];
|
|
attachments?: EmailAttachment[];
|
|
};
|
|
|
|
type EmailAttachment = {
|
|
filename: string;
|
|
content?: Buffer | string;
|
|
path?: string;
|
|
contentType?: string;
|
|
cid?: string; // content-ID for embedded images
|
|
};
|
|
|
|
type EmailResult = {
|
|
success: boolean;
|
|
messageId?: string;
|
|
error?: string;
|
|
};
|
|
|
|
export type { MailerConfig, EmailOptions, EmailAttachment, EmailResult };
|