diff --git a/README.md b/README.md index 3188452..2828ada 100644 --- a/README.md +++ b/README.md @@ -120,7 +120,7 @@ explains what does have access instead. | `orders` | Persisted checkout orders, `/konto/bestellungen*` | `orderNumber`, `invoiceNumber`/`invoiceIssuedAt`, `correctionInvoiceNumber`/`correctionInvoiceIssuedAt` (see "Invoice PDFs" below), `status` (`received`/`processing`/`shipped`/`delivered`/`cancelled`/`return_requested`/`returned` — the first 4 maintained by hand in the admin, no carrier API; the rest see "Order cancellation & returns"), `returnReason` (captured from the customer on a return request), full address/items (each with a snapshotted `taxRatePercent`/`bundleContents`)/totals at order time. **Not public-read** — created only via `ORDER_SERVICE_SECRET`, read/updated by admin or the order's own customer | | `customers` | Storefront accounts — register/login/order-history, a second `auth: true` collection separate from the Payload admin's own `users` login | `customerNumber`, `firstName`/`lastName`/`email`, one default address, `cart` (server-side mirror), `emailVerified` (non-blocking). **Not public-read** — see "Orders & customer accounts" below | | `number-ranges` | Admin-configurable prefix + running counter for customer/order/invoice/correction-invoice numbers — one row per tenant | `customerPrefix`/`customerNext`/`customerPadding`, `orderPrefix`/`orderNext`/`orderPadding`, `invoicePrefix`/`invoiceNext`/`invoicePadding`, `correctionInvoicePrefix`/`correctionInvoiceNext`/`correctionInvoicePadding` (Stornorechnung/Gutschrift — its own gapless sequence, not the same counter as `invoice*`, see "Invoice PDFs" below). **Admin-only**, no frontend read at all — internal to the two `beforeChange` hooks that assign these numbers | -| `email-templates` | Editable subject/heading/body/footer for all 6 transactional emails this shop sends (see "Email templates & Live Preview" and "Status-change emails" below) | `type` (`order-confirmation`/`password-reset`/`order-shipped`/`order-cancelled`/`order-return-requested`/`order-returned`), `subject`, `heading`, `bodyText`, `footerText`. Public-read, has a Live Preview button | +| `email-templates` | Editable subject/heading/body/footer for all 9 transactional emails this shop sends (see "Email templates & Live Preview" and "Status-change emails" below) | `type` (`order-confirmation`/`password-reset`/`order-shipped`/`order-cancelled`/`order-return-requested`/`order-returned`/`order-tracking-added`/`order-tracking-corrected`/`order-delivered`), `subject`, `heading`, `bodyText`, `footerText`. Public-read, has a Live Preview button | | `company-settings` | Structured business data for invoice PDFs *and* every email's legal footer (Anbieterkennzeichnung, see "Invoice PDFs" below) — one row per tenant, own **Company** admin group (not Commerce — this is business identity, not a storefront concern) | `sellerName`/`sellerStreet`/`sellerZip`/`sellerCity`/`sellerCountry`/`sellerEmail`, `vatId`, `taxRatePercent` (admin-editable, not hardcoded), `bankName`/`iban`/`bic` (`iban`/`bic` format-validated + uppercase-normalized; `bankName` stays free text — replaced a single free-text `bankDetails` field). **Not public-read** — admin or `ORDER_SERVICE_SECRET`. Has a Live Preview button — see "Company Settings & Live Preview" below | All of the above except `company-settings`, `media`, `users`, `tenants` @@ -1465,13 +1465,33 @@ links to `/konto/passwort-vergessen`. ### Email templates & Live Preview -All 6 transactional emails (order confirmation, password reset, and the 4 -status-change types below) read their subject/heading/body/footer wording -from Payload's `email-templates` collection — editable in the admin -without a deploy, with a Live Preview button using the exact same -mechanism as Posts/LegalPages/Testimonials (`useLivePreview()` from -`@payloadcms/live-preview-react`, already a dependency here for -`LivePostContent.tsx`). +All 9 transactional emails (order confirmation, password reset, and the 7 +status-change types below — the original 4 plus `order-tracking-added`/ +`order-tracking-corrected`/`order-delivered`, added 2026-07-25) read their +subject/heading/body/footer wording from Payload's `email-templates` +collection — editable in the admin without a deploy, with a Live Preview +button using the exact same mechanism as Posts/LegalPages/Testimonials +(`useLivePreview()` from `@payloadcms/live-preview-react`, already a +dependency here for `LivePostContent.tsx`). + +**Live Preview only reliably updates when popped out into its own +browser tab/window, not in the embedded admin panel.** Root cause: the +preview goes through `buildPreviewUrl()` on the Payload side, which hits +`/api/preview` on this frontend's own origin to enable Next.js Draft +Mode via a cookie — but admin (`payload.mk360.de`) and frontend +(`einfach-produktiv.mk360.de`) are different origins, so from inside the +admin's embedded `