table import works now
Some checks failed
Deploy to Server / deploy (push) Failing after 1m7s

This commit is contained in:
2026-04-24 18:19:54 -05:00
parent 4098453c97
commit 24d126eeb9
6 changed files with 524 additions and 118 deletions

View File

@@ -2,10 +2,10 @@ import FormData from 'form-data';
import Mailgun from 'mailgun.js';
const mailgun = new (Mailgun as any)(FormData);
const mg = mailgun.client({
const mg = process.env.MAILGUN_API_KEY ? mailgun.client({
username: 'api',
key: process.env.MAILGUN_API_KEY || '',
});
key: process.env.MAILGUN_API_KEY,
}) : null;
const DOMAIN = process.env.MAILGUN_DOMAIN || 'sandbox06aa4efa8cc342878b7470a7c9113df3.mailgun.org';
const FROM = process.env.FROM_EMAIL || `LabWise <postmaster@${DOMAIN}>`;
@@ -19,6 +19,10 @@ export async function sendEmail({
subject: string;
html: string;
}) {
if (!mg) {
console.warn('[auth] MAILGUN_API_KEY is not set. Email not sent:', subject);
return;
}
await mg.messages.create(DOMAIN, {
from: FROM,
to: [to],