diff --git a/shop/app/api/admin/orders/[id]/download/route.ts b/shop/app/api/admin/orders/[id]/download/route.ts index 3ad8c32..f94014b 100644 --- a/shop/app/api/admin/orders/[id]/download/route.ts +++ b/shop/app/api/admin/orders/[id]/download/route.ts @@ -115,12 +115,13 @@ export async function GET( const downloadFileName = `Anfragebestaetigung_${order.order_number || id.slice(0, 8)}.pdf`; const headers = new Headers(); + headers.append("Content-Type", "application/pdf"); + headers.append("Cache-Control", "private, no-cache"); if (inline) { - headers.append("Content-Disposition", "inline"); + headers.append("Content-Disposition", `inline; filename="${downloadFileName}"`); } else { headers.append("Content-Disposition", `attachment; filename="${downloadFileName}"`); } - headers.append("Content-Type", "application/pdf"); return new NextResponse(fileBuffer as any, { status: 200, diff --git a/shop/app/api/orders/[id]/download/route.ts b/shop/app/api/orders/[id]/download/route.ts index d73d856..e846b8e 100644 --- a/shop/app/api/orders/[id]/download/route.ts +++ b/shop/app/api/orders/[id]/download/route.ts @@ -115,12 +115,13 @@ export async function GET( const downloadFileName = `Anfragebestaetigung_${order.order_number || id.slice(0, 8)}.pdf`; const headers = new Headers(); + headers.append("Content-Type", "application/pdf"); + headers.append("Cache-Control", "private, no-cache"); if (inline) { - headers.append("Content-Disposition", "inline"); + headers.append("Content-Disposition", `inline; filename="${downloadFileName}"`); } else { headers.append("Content-Disposition", `attachment; filename="${downloadFileName}"`); } - headers.append("Content-Type", "application/pdf"); return new NextResponse(fileBuffer as any, { status: 200, diff --git a/shop/lib/actions/orders.ts b/shop/lib/actions/orders.ts index 39e1e56..e5c9850 100644 --- a/shop/lib/actions/orders.ts +++ b/shop/lib/actions/orders.ts @@ -327,7 +327,7 @@ export async function submitOrder(params: { await sendMail({ to: user.email, subject: `Anfragebestätigung ${orderNumber}`, - text: `Hallo,\n\nvielen Dank für Ihre Anfrage bei CASPOS Shop!\n\nAnfragedetails:\n- Anfrage-Nummer: ${orderNumber}\n- Datum: ${formattedDate}\n- Endkunde: ${customerSnapshot.company_name}\n${totalDetailsText}\n\nIm Anhang dieser E-Mail finden Sie Ihre Anfragebestätigung als PDF-Dokument.\n\nViele Grüße,\nIhr CASPOS Shop-Team`, + text: `Hallo,\n\nvielen Dank für Ihre Anfrage bei CASPOS Shop!\n\nAnfragedetails:\n- Anfrage-Nummer: ${orderNumber}\n- Datum: ${formattedDate}\n- Endkunde: ${customerSnapshot.company_name}\n${totalDetailsText}\n\nIm Anhang dieser E-Mail finden Sie Ihre Anfragebestätigung als PDF-Dokument.\n\nPDF herunterladen: ${process.env.NEXT_PUBLIC_SITE_URL || 'https://staging.hephex.de'}/api/orders/${order.id}/download\n\nViele Grüße,\nIhr CASPOS Shop-Team`, html: `
Im Anhang dieser E-Mail finden Sie Ihre Anfragebestätigung als PDF-Dokument.
+Mit freundlichen Grüßen,
Ihr CASPOS Shop-Team
Diese E-Mail wurde automatisch generiert. Bitte antworten Sie nicht darauf.
@@ -755,7 +758,7 @@ export async function updateOrder( await sendMail({ to: orderUserEmail, subject: `Anfrageänderung ${order.order_number}`, - text: `Hallo,\n\nihre Anfrage wurde erfolgreich aktualisiert!\n\nNeue Anfragedetails:\n- Anfrage-Nummer: ${order.order_number}\n- Datum: ${formattedDate}\n- Endkunde: ${customerSnapshot.company_name}\n${totalDetailsText}\n\nIm Anhang dieser E-Mail finden Sie Ihre aktualisierte Anfrage als PDF-Dokument.\n\nViele Grüße,\nIhr CASPOS Shop-Team`, + text: `Hallo,\n\nihre Anfrage wurde erfolgreich aktualisiert!\n\nNeue Anfragedetails:\n- Anfrage-Nummer: ${order.order_number}\n- Datum: ${formattedDate}\n- Endkunde: ${customerSnapshot.company_name}\n${totalDetailsText}\n\nIm Anhang dieser E-Mail finden Sie Ihre aktualisierte Anfrage als PDF-Dokument.\n\nPDF herunterladen: ${process.env.NEXT_PUBLIC_SITE_URL || 'https://staging.hephex.de'}/api/orders/${order.id}/download\n\nViele Grüße,\nIhr CASPOS Shop-Team`, html: `Im Anhang dieser E-Mail finden Sie Ihre aktualisierte Anfragebestätigung als PDF-Dokument.
+Mit freundlichen Grüßen,
Ihr CASPOS Shop-Team