import nodemailer from "nodemailer"; import { getSmtpSettings } from "./integration-settings"; export async function sendMail(to: string, subject: string, text: string): Promise { const smtp = await getSmtpSettings(); const t = nodemailer.createTransport({ host: smtp.host || undefined, port: smtp.port, auth: smtp.user || smtp.pass ? { user: smtp.user, pass: smtp.pass } : undefined, }); await t.sendMail({ from: smtp.from || undefined, to, subject, text }); }