diff options
| author | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-05-12 11:32:25 +0000 |
|---|---|---|
| committer | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-05-12 11:32:25 +0000 |
| commit | 20b1a8e6e39b3adf058b32f1b2e219ee93a9f1c7 (patch) | |
| tree | 429e0d4c656c365a8cb0a5eb800dd4a4e4f2c152 /lib/mail/sendEmail.ts | |
| parent | 552c82fa3632965949d56317d8730ac3341f22a4 (diff) | |
(대표님) 메일 발송 - 언어별 템플릿 추가 및 rfq 알림림
Diffstat (limited to 'lib/mail/sendEmail.ts')
| -rw-r--r-- | lib/mail/sendEmail.ts | 15 |
1 files changed, 12 insertions, 3 deletions
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<string, any>; // 템플릿에 주입할 데이터 - 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 }); } - |
