From d454843856570b124d956656bbed14e12c5ffb1f Mon Sep 17 00:00:00 2001 From: Gerhard Scheikl Date: Sat, 9 May 2026 17:14:20 +0200 Subject: [PATCH] fix(email): use invoice language so email matches PDF attachment --- app/services/invoice/email.server.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/services/invoice/email.server.ts b/app/services/invoice/email.server.ts index a73982a..b03420b 100644 --- a/app/services/invoice/email.server.ts +++ b/app/services/invoice/email.server.ts @@ -67,8 +67,10 @@ export async function sendInvoiceEmail( } if (!to) return failLog(args, "No recipient email available.", invoice.id); - // Build email content. - const language = pickLanguage(args.customerLocale ?? settings.defaultLanguage); + // Build email content. Always use the language the invoice PDF was + // rendered in, so the email matches the attachment. Caller can still + // override via `customerLocale` if they really want a different language. + const language = pickLanguage(args.customerLocale ?? invoice.language ?? settings.defaultLanguage); const t = getStrings(language); const customer = parseCustomer(invoice.customerJson); const totals = parseTotals(invoice.totalsJson);