Refine workspaces and event publishing; harden uploads and email delivery
This commit is contained in:
@@ -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");
|
||||
Reference in New Issue
Block a user