Email mark.mullings@blackdice.ai on every toolkit submission
Adds an SMTP-based notification (server/mailer.js) that fires whenever a visitor registers or downloads an ROI report, configured via NOTIFY_EMAIL/SMTP_* env vars. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -2,6 +2,7 @@ import 'dotenv/config';
|
||||
import cors from 'cors';
|
||||
import express from 'express';
|
||||
import { pool } from './db.js';
|
||||
import { notifySubmission } from './mailer.js';
|
||||
|
||||
const app = express();
|
||||
|
||||
@@ -35,6 +36,7 @@ app.post('/api/webhook', async (req, res) => {
|
||||
} else {
|
||||
return res.status(400).json({ ok: false, error: `Unknown event: ${event}` });
|
||||
}
|
||||
notifySubmission({ event, lead, roi, submittedAt }).catch((err) => console.error('[mail] notify failed:', err));
|
||||
res.json({ ok: true });
|
||||
} catch (err) {
|
||||
console.error('[db] write failed:', err);
|
||||
|
||||
Reference in New Issue
Block a user