29 lines
1.0 KiB
TypeScript
29 lines
1.0 KiB
TypeScript
export type MailConfig = {
|
|
smtpHost: string;
|
|
smtpPort: number;
|
|
smtpSecure: boolean;
|
|
smtpUser: string;
|
|
smtpPassword: string;
|
|
fromName: string;
|
|
fromAddress: string;
|
|
bccAddress: string;
|
|
sendEnabled: boolean;
|
|
/** 설정 시 모든 수신인을 이 주소로 고정 (local/stage 테스트용) */
|
|
overrideTo: string | undefined;
|
|
};
|
|
|
|
export function getMailConfig(): MailConfig {
|
|
return {
|
|
smtpHost: process.env.MAIL_SMTP_HOST ?? "smtp.gmail.com",
|
|
smtpPort: Number(process.env.MAIL_SMTP_PORT ?? "465"),
|
|
smtpSecure: process.env.MAIL_SMTP_SECURE !== "false",
|
|
smtpUser: process.env.MAIL_SMTP_USER ?? "",
|
|
smtpPassword: process.env.MAIL_SMTP_PASSWORD ?? "",
|
|
fromName: process.env.MAIL_FROM_NAME ?? "초코마에",
|
|
fromAddress: process.env.MAIL_FROM_ADDRESS ?? "",
|
|
bccAddress: process.env.MAIL_BCC_ADDRESS ?? "",
|
|
sendEnabled: process.env.MAIL_SEND_ENABLED === "true",
|
|
overrideTo: process.env.MAIL_OVERRIDE_TO || undefined,
|
|
};
|
|
}
|