This service starts with order intake and email sending off. Your approved thank-you designs and artwork are included.
Connect your accounts in one batch
In Cloudflare, create a new empty D1 database. In this Pages project's Settings → Bindings, add a D1 binding named DB and select that database.
In Settings → Variables and Secrets, add encrypted secrets BREVO_API_KEY, STRIPE_API_KEY, STRIPE_WEBHOOK_SECRET and ADMIN_TOKEN. Create and enter keys directly in the official services and Cloudflare, never chat. Start with a Stripe sandbox restricted key with Checkout Sessions Read permission only.
In Stripe's sandbox, create a snapshot webhook destination for checkout.session.completed and checkout.session.async_payment_succeeded. Its endpoint is https://the-true-king-order-emails-test.pages.dev/stripe/webhook. Copy its signing secret directly into the encrypted Cloudflare secret above.
Set the text variable PUBLIC_ORIGIN to https://the-true-king-order-emails-test.pages.dev. Keep intake and sending off. Set TEST_PAYMENT_LINK_TYPES to the approved sandbox link mapping provided for this setup. Do not reuse live link IDs in sandbox.
Save all settings and redeploy this same ZIP so bindings and secrets take effect. Use the private administration key below to initialize the empty database, then check setup. No email is sent by either button.
Create your private administration key locally
Generate it in this browser, save it privately, then enter it directly as encrypted ADMIN_TOKEN in Cloudflare. It is not sent by this generator.
Enter the private key only when checking your own service.
Before sending
Sender identity, minimal-record retention, order eligibility window, activation cutoff, and permission for the intended test or customer messages must be approved. Sandbox sends are restricted to thetruekingbookseries@outlook.com. Live mode requires separate explicit settings and customer-send approval.
Stripe retries have a limited window. Pending retries and uncertain outcomes appear in the private review. Uncertain outcomes are never automatically resent. Check the Brevo log before deciding whether a message needs recovery.