Email marketing V2

This commit is contained in:
2026-07-29 10:42:21 +02:00
parent 11fdec610f
commit 6fd0ed8522
9 changed files with 256 additions and 53 deletions

View File

@@ -48,10 +48,15 @@ export default function SignupClient() {
body: JSON.stringify({ name, email, password }),
});
const data = await response.json();
if (response.ok && data.success) {
// Store user in localStorage for client-side
const data = await response.json();
if (response.ok && data.success) {
if (data.requiresEmailVerification) {
router.push(`/verify-email?email=${encodeURIComponent(data.email)}`);
return;
}
// Store user in localStorage for client-side
localStorage.setItem('user', JSON.stringify(data.user));
// Track successful signup with PostHog

View File

@@ -0,0 +1,28 @@
import Link from 'next/link';
export const metadata = {
title: 'Check your email | QR Master',
robots: { index: false, follow: false },
};
export default function VerifyEmailPage({ searchParams }: { searchParams: { email?: string; status?: string } }) {
const expired = searchParams.status === 'expired';
return (
<main className="flex min-h-screen items-center justify-center bg-gradient-to-br from-primary-50 to-white p-4">
<section className="w-full max-w-md rounded-xl bg-white p-8 shadow-[0_22px_42px_-30px_rgba(50,50,93,0.38)]">
<Link href="/" className="text-sm font-semibold text-primary-700">QR MASTER</Link>
<h1 className="mt-8 text-3xl font-semibold tracking-tight text-slate-950">
{expired ? 'This confirmation link has expired.' : 'Check your inbox.'}
</h1>
<p className="mt-3 text-sm leading-6 text-slate-600">
{expired
? 'Please create your account again to receive a new confirmation email.'
: <>We sent a confirmation link{searchParams.email ? <> to <strong className="font-medium text-slate-800">{searchParams.email}</strong></> : ''}. Open it to finish creating your account.</>}
</p>
<p className="mt-6 text-sm leading-6 text-slate-500">The link expires in 24 hours. Check your spam folder if it does not arrive shortly.</p>
<Link href="/login" className="mt-8 inline-flex text-sm font-medium text-primary-700 hover:text-primary-800">Back to sign in</Link>
</section>
</main>
);
}