From 20b1a8e6e39b3adf058b32f1b2e219ee93a9f1c7 Mon Sep 17 00:00:00 2001 From: dujinkim Date: Mon, 12 May 2025 11:32:25 +0000 Subject: (대표님) 메일 발송 - 언어별 템플릿 추가 및 rfq 알림림 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/mail/sendEmail.ts | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'lib/mail/sendEmail.ts') diff --git a/lib/mail/sendEmail.ts b/lib/mail/sendEmail.ts index c4171082..97617e7a 100644 --- a/lib/mail/sendEmail.ts +++ b/lib/mail/sendEmail.ts @@ -7,7 +7,9 @@ interface SendEmailOptions { subject: string; template: string; // 템플릿 파일명(확장자 제외) context: Record; // 템플릿에 주입할 데이터 - attachments?: { // NodeMailer "Attachment" 타입 + cc?: string | string[]; // cc 필드 추가 - 단일 이메일 또는 이메일 배열 + attachments?: { + // NodeMailer "Attachment" 타입 filename?: string path?: string content?: Buffer | string @@ -15,7 +17,14 @@ interface SendEmailOptions { }[] } -export async function sendEmail({ to, subject, template, context, attachments = []}: SendEmailOptions) { +export async function sendEmail({ + to, + subject, + template, + context, + cc, // cc 매개변수 추가 + attachments = [] +}: SendEmailOptions) { const { t, i18n } = await useTranslation(context.language ?? "en", "translation"); handlebars.registerHelper("t", function (key: string, options: any) { @@ -28,9 +37,9 @@ export async function sendEmail({ to, subject, template, context, attachments = await transporter.sendMail({ from: `"${process.env.Email_From_Name}" <${process.env.Email_From_Address}>`, to, + cc, // cc 필드 추가 subject, html, attachments }); } - -- cgit v1.2.3