Phase 11. 이메일 발송 환경 및 자동 발송

This commit is contained in:
2026-07-02 18:09:42 +09:00
parent 5f9bb39ce1
commit b2483a1b77
11 changed files with 667 additions and 83 deletions
+28
View File
@@ -0,0 +1,28 @@
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,
};
}