Phase 11. 이메일 발송 환경 및 자동 발송
This commit is contained in:
@@ -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,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user