Fix broken email-preview rendering, add payment status to order list, second sample state
- LiveEmailPreviewClient.tsx rendered the email HTML (a full <body>... fragment) via dangerouslySetInnerHTML into a plain div, nesting it inside the page's own already-existing <body> — invalid HTML the browser silently mangled. Switched to an <iframe srcDoc>, giving the email its own real document context, exactly like an actual email client would render it. - Added SAMPLE_ORDER_MANUAL + a toggle in the preview so both order-confirmation states (paid vs. Vorkasse/Überweisung, incl. the new "switch to Kreditkarte/PayPal" mention) are actually visible in the admin's Live Preview — SAMPLE_ORDER alone always had isManualPayment: false, so the Vorkasse branch was never previewable at all before this. - /konto/bestellungen (the order list, not just the single-order detail page) now also shows the payment status badge next to the existing fulfillment status one — CustomerOrder was missing paymentStatus entirely.
This commit is contained in:
@@ -246,6 +246,17 @@ export const SAMPLE_ORDER: OrderConfirmationData = {
|
||||
isManualPayment: false,
|
||||
};
|
||||
|
||||
// Second preview fixture — demonstrates the Vorkasse/Überweisung branch
|
||||
// (vorkasseNotice(), incl. the "switch to Kreditkarte/PayPal" mention)
|
||||
// that SAMPLE_ORDER's own isManualPayment: false never shows. Used by
|
||||
// LiveEmailPreviewClient.tsx's toggle, not by any real send — a real
|
||||
// order-confirmation email always computes both flags live per order.
|
||||
export const SAMPLE_ORDER_MANUAL: OrderConfirmationData = {
|
||||
...SAMPLE_ORDER,
|
||||
isManualPayment: true,
|
||||
hasOnlinePaymentOption: true,
|
||||
};
|
||||
|
||||
export function renderOrderConfirmationHtml(template: EmailTemplateContent, order: OrderConfirmationData, seller: CompanySettings | null): string {
|
||||
const rows = order.items
|
||||
.map(
|
||||
|
||||
Reference in New Issue
Block a user