init
All checks were successful
Deploy / build (push) Successful in 2m27s

This commit is contained in:
alsaze
2025-12-04 14:45:37 +03:00
parent faf95ec89c
commit 3c4ec7aada
9 changed files with 75 additions and 66 deletions

View File

@@ -0,0 +1,29 @@
import nodemailer from 'nodemailer'
export default defineEventHandler(async (event) => {
const body = await readBody(event)
const transporter = nodemailer.createTransport({
host: 'smtp.yandex.ru',
port: 465,
secure: true,
auth: {
user: process.env.SMTP_USER,
pass: process.env.SMTP_APP_PASSWORD,
},
})
await transporter.sendMail({
from: `"Rental Concierge" <${process.env.SMTP_USER}>`,
to: 'info@rental-concierge.com',
subject: 'Новая заявка',
html: `
<b>Имя:</b> ${body.name}<br>
<b>Телефон:</b> ${body.phone}<br>
<b>Услуга:</b> ${body.service}<br>
<b>Комментарий:</b> ${body.comment}
`,
})
return { ok: true }
})