feat(email): add primaryColor branding param to email templates

This commit is contained in:
DanielS
2026-08-27 00:32:18 +02:00
parent f68d67de43
commit 0c99da2eeb
3 changed files with 25 additions and 8 deletions

View File

@@ -295,6 +295,9 @@ export async function POST(request: Request) {
const itemsSection = buildEmailItemsSection(items);
const { data: brandData } = await supabase.from('settings').select('primary_color').eq('id', 'branding').maybeSingle();
const primaryColor = brandData?.primary_color || '#2563eb';
const emailTemplate = getOrderEmailTemplate({
orderNumber: order.order_number,
formattedDate,
@@ -303,7 +306,7 @@ export async function POST(request: Request) {
totalDetailsHtml,
itemsDetailsText: itemsSection.text,
itemsDetailsHtml: itemsSection.html
}, `${process.env.NEXT_PUBLIC_SITE_URL || 'https://staging.hephex.de'}`, false);
}, `${process.env.NEXT_PUBLIC_SITE_URL || 'https://staging.hephex.de'}`, false, primaryColor);
const { data: bufferData, error: downloadError } = await supabase
.storage