fix(email): use invoice language so email matches PDF attachment
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user