This commit is contained in:
2024-06-06 15:14:23 +05:00
parent af10788000
commit ccca61d2bf
9 changed files with 288 additions and 169 deletions
+38
View File
@@ -0,0 +1,38 @@
import { Router } from "express";
import nodemailer from "nodemailer";
const router = Router();
router.post("/", async (req, res) => {
const { email, link } = req.body;
console.log("email", email);
console.log("link", link);
// create reusable transporter object using the default SMTP transport
let transporter = nodemailer.createTransport({
host: "mail.netangels.ru",
port: 587,
secure: false, // true for 465, false for other ports
auth: {
user: "stream@graff.tech", // generated ethereal user
pass: "zLUbt8Io7dh2F9KT", // generated ethereal password
},
});
// send mail with defined transport object
await transporter.sendMail({
from: "stream@graff.tech", // sender address
to: email, // list of receivers
subject: "Приглашение на демонстрацию - stream.graff.tech", // Subject line
html: `<div>
Ссылка для подключения к демонстрации: <a href="${link}" target="_blank">${link}</a>
</div>`,
});
res.json({ ok: 1 });
});
const sendInviteRouter = router;
export default sendInviteRouter;