f0df359db4
Password reset uses Payload's built-in forgot/reset-password flow, customized to link to this app instead of the Payload admin. Order confirmation email and the password-reset email's wording both come from a new Payload email-templates collection, editable without a deploy and previewable via Live Preview at /email-preview/[type] (same mechanism as Posts/LegalPages/Testimonials, sample data instead of a real document). Also: order numbers get a random suffix (prevents guessing, motivated by a considered-and-deferred guest order-lookup feature); the discount code field only shows in the cart when a code is actually active (codes now apply via a ?code= link instead of manual entry); and three navigation gaps found while testing — no reachable login link with an empty cart, no logout link anywhere, no way back from profile to order history. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
20 lines
811 B
TypeScript
20 lines
811 B
TypeScript
import nodemailer from "nodemailer";
|
|
|
|
// Server-only. This app's own SMTP connection, deliberately independent of
|
|
// Payload's (which also sends mail now — see Customers.ts's verification/
|
|
// password-reset emails on the Payload side) — critical-error alerts in
|
|
// particular need to still go out even if Payload itself is what's broken.
|
|
// Same Hostinger account either way (already proven working via Diun's
|
|
// update notifications), just a second, separate connection to it. Shared
|
|
// by alertAdmin.ts and orderEmail.ts so there's exactly one transport
|
|
// instance, not one per call site.
|
|
export const transport = nodemailer.createTransport({
|
|
host: "smtp.hostinger.com",
|
|
port: 587,
|
|
secure: false,
|
|
auth: {
|
|
user: process.env.SMTP_USER || "",
|
|
pass: process.env.SMTP_PASSWORD || "",
|
|
},
|
|
});
|