This repository has been archived on 2026-09-03. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
itsthevine/scripts/test-email.mjs
T
Austin 5c81b65e51 Rebrand to Sage & Cream identity, working contact form, drop Firebase
- New sage/cream palette and stacked logo lockup (The Vine over Coffeehouse
  + Bakery) driven by currentColor; logo SVGs now colorable
- Reuse the logo component for the hero and section marks
- Rewrite site copy: real founding (Morissa Bennett, 2024), real story from
  the product range, remove invented claims and AI phrasing
- Contact form now sends over SMTP via /api/contact (nodemailer) with real
  send/error states, server-side validation, and reply-to the customer;
  delivers to CONTACT_TO. Add .env.example and a test-email script
- Fix mobile: unmount the off-screen menu (killed sideways scroll), cap logo
  width, responsive heroes and type
- Remove Firebase (config, tracked build output, placeholder pages, nix
  firebase-tools) now that hosting has moved
- Delete dead code: LoyaltyCardForm, ProductModal, LoadingSpinner, card-flip
  CSS, unused Playfair font
- Serve dev/start on port 2024
2026-07-14 17:48:00 -05:00

43 lines
1.5 KiB
JavaScript

// Sends one test email through the configured SMTP server, then exits.
// node --env-file=.env scripts/test-email.mjs [recipient]
// Verifies the connection first, so auth/TLS problems are reported distinctly
// from delivery problems.
import nodemailer from 'nodemailer';
const { SMTP_SERVER, SMTP_PORT, SMTP_USERNAME, SMTP_TOKEN, CONTACT_FROM } = process.env;
const to = process.argv[2] || process.env.CONTACT_TO;
const missing = ['SMTP_SERVER', 'SMTP_PORT', 'SMTP_USERNAME', 'SMTP_TOKEN'].filter((k) => !process.env[k]);
if (missing.length) {
console.error(`Missing env vars: ${missing.join(', ')}`);
console.error('Fill in .env (see .env.example), then re-run.');
process.exit(1);
}
if (!to) {
console.error('No recipient. Pass one as an argument or set CONTACT_TO.');
process.exit(1);
}
const port = Number(SMTP_PORT);
const transporter = nodemailer.createTransport({
host: SMTP_SERVER,
port,
secure: port === 465,
auth: { user: SMTP_USERNAME, pass: SMTP_TOKEN },
});
console.log(`Connecting to ${SMTP_SERVER}:${port} (secure=${port === 465}) as ${SMTP_USERNAME}...`);
await transporter.verify();
console.log('SMTP connection and auth OK.');
const info = await transporter.sendMail({
from: CONTACT_FROM || SMTP_USERNAME,
to,
subject: 'The Vine — contact form test',
text: 'This is a test from the itsthevine.com contact form wiring. If you are reading this, SMTP works.',
});
console.log(`Sent to ${to}`);
console.log(`messageId: ${info.messageId}`);
if (info.rejected?.length) console.log(`rejected: ${info.rejected.join(', ')}`);