Refine workspaces and event publishing; harden uploads and email delivery

This commit is contained in:
2026-09-09 15:44:00 -04:00
parent f5702caaea
commit 574f29a68e
93 changed files with 2885 additions and 535 deletions
+13
View File
@@ -0,0 +1,13 @@
import { sendAccountVerificationEmail, sendPasswordResetEmail, sendStaffInviteEmail, sendAlbumReadyEmail } from "../packages/email/src/index";
if (process.env.NODE_ENV === "production" || process.env.EMAIL_PROVIDER !== "mailpit" || !["localhost", "127.0.0.1"].includes(process.env.SMTP_HOST ?? "") || process.env.SMTP_PORT !== "1027") {
throw new Error("Email previews require this project's local Mailpit (127.0.0.1:1027). Production sending is forbidden.");
}
const to = "email-previews@manyangles.test";
const origin = "http://localhost:3000";
await sendAccountVerificationEmail({ to, name: "Alex", verificationUrl: `${origin}/sign-in?preview=verification` });
await sendPasswordResetEmail({ to, name: "Alex", resetUrl: `${origin}/reset-password?token=preview-not-a-real-token` });
await sendStaffInviteEmail({ to, inviterName: "Riverhead Raceway", inviteUrl: `${origin}/invitations/preview-not-a-real-invite` });
await sendAlbumReadyEmail({ to, eventTitle: "Riverhead Raceway Championship Night", galleryUrl: `${origin}/e/demo` });
console.info("Four email previews sent to local Mailpit: http://localhost:8027");