import { createTransport } from 'nodemailer' const transporter = createTransport({ host: process.env.EMAIL_HOST, port: parseInt(process.env.EMAIL_PORT || '587'), secure: process.env.EMAIL_SSL === 'true', auth: { user: process.env.NOREPLY_EMAIL, pass: process.env.NOREPLY_PASSWORD, }, }) export async function sendOTPEmail(email: string, otp: string) { try { const result = await transporter.sendMail({ from: process.env.NOREPLY_EMAIL || 'noreply@librecloud.cc', to: email, subject: 'LibreCloud OTP', text: `Your OTP code is: ${otp}\n\nThis code will expire in 10 minutes.`, html: `
Your OTP code is: ${otp}
This code will expire in 10 minutes.
If you didn't request this code, please ignore this email.