feat: implement language-based email template selection

Update email worker to select templates based on BillingLocation.tenantEmailLanguage:
- Change default language from 'en' to 'hr' in emailTemplates.ts
- Pass language parameter (location.tenantEmailLanguage || 'hr') to all loadAndRender calls
- Applies to email validation, rent due, and utility bills notifications

Email templates are now automatically selected based on tenant's language preference,
defaulting to Croatian when not specified.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Knee Cola
2025-12-31 11:07:39 +01:00
parent 7bf7f9580f
commit d7abd99448
2 changed files with 5 additions and 5 deletions

View File

@@ -59,7 +59,7 @@ export async function sendVerificationRequests(db: Db, budget: number): Promise<
'ownerName': ownerName,
'location.name': location.name,
'shareId': shareId
});
}, location.tenantEmailLanguage || 'hr');
const success = await sendEmail({
to: location.tenantEmail,
@@ -161,7 +161,7 @@ export async function sendRentDueNotifications(db: Db, budget: number): Promise<
'currency': currency,
'ownerName': ownerName,
'shareId': shareId
});
}, location.tenantEmailLanguage || 'hr');
const success = await sendEmail({
to: location.tenantEmail,
@@ -254,7 +254,7 @@ export async function sendUtilityBillsNotifications(db: Db, budget: number): Pro
'currency': currency,
'ownerName': ownerName,
'shareId': shareId
});
}, location.tenantEmailLanguage || 'hr');
const success = await sendEmail({
to: location.tenantEmail,