diff --git a/.env.example b/.env.example index 0f21686..ea7670d 100644 --- a/.env.example +++ b/.env.example @@ -3,4 +3,5 @@ SMTP_PORT=2525 SMTP_USER=your_smtp_user SMTP_PASS=your_smtp_password EMAIL_FROM=noreply@example.com +EMAIL_REPLYTO=noreply@example.com REDIS_URL=redis://localhost:6379 \ No newline at end of file diff --git a/bun.lockb b/bun.lockb index 5e29ba7..52f72d6 100644 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index 78261b0..c225661 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ }, "devDependencies": { "@types/node": "22.9.1", + "@types/nodemailer": "^6.4.17", "bun-types": "1.1.36" } } diff --git a/src/config/env.ts b/src/config/env.ts index 9cbcfff..4572a29 100644 --- a/src/config/env.ts +++ b/src/config/env.ts @@ -6,7 +6,8 @@ export const config = { pass: process.env.SMTP_PASS || '' }, email: { - from: process.env.EMAIL_FROM || 'noreply@example.com' + from: process.env.EMAIL_FROM || 'noreply@example.com', + replyTo: process.env.EMAIL_REPLYTO || 'noreply@example.com', }, redis: { url: process.env.REDIS_URL || 'redis://localhost:6379' diff --git a/src/queues/email.queue.ts b/src/queues/email.queue.ts index 915928d..e8ef139 100644 --- a/src/queues/email.queue.ts +++ b/src/queues/email.queue.ts @@ -41,10 +41,11 @@ const worker = new Worker( async (job) => { await transporter.sendMail({ from: config.email.from, + replyTo: config.email.replyTo, to: job.data.to, subject: job.data.subject, text: job.data.text, - html: job.data.html + html: job.data.html, }) }, {