actually start on mailing, fix email regex
Some checks failed
Code quality checks / biome (push) Failing after 22s
Some checks failed
Code quality checks / biome (push) Failing after 22s
This commit is contained in:
parent
00a7417936
commit
86be889ede
17 changed files with 349 additions and 32 deletions
|
@ -13,30 +13,4 @@ type MailerConfig = {
|
|||
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 };
|
||||
export type { MailerConfig };
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
export * from "./validation";
|
||||
export * from "./mailer";
|
||||
|
|
45
types/lib/mailer.ts
Normal file
45
types/lib/mailer.ts
Normal 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 };
|
|
@ -1,4 +1,5 @@
|
|||
import type { BaseResponse, UserResponse } from "./base";
|
||||
import type { BaseResponse } from "../base";
|
||||
import type { UserResponse } from "./base";
|
||||
|
||||
interface RegisterRequest {
|
||||
username: string;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue