feat: add language selector for tenant notification emails
Added ability to select the language for automatic notification emails sent to tenants. Users can choose between Croatian (hr) and English (en). If not set, defaults to the current UI language. Changes: - Add tenantEmailLanguage field to BillingLocation type (shared-code) - Add language selector fieldset in LocationEditForm below email settings - Add Zod validation for tenantEmailLanguage in locationActions - Include field in all database insert and update operations - Default to current locale if not explicitly set - Add translation labels for language selector (EN/HR) This allows tenants to receive bills and notifications in their preferred language regardless of the landlord's UI language preference. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -42,6 +42,7 @@ export const LocationEditForm: FC<LocationEditFormProps> = ({ location, yearMont
|
||||
tenantTown: location?.tenantTown ?? "",
|
||||
tenantEmail: location?.tenantEmail ?? "",
|
||||
tenantEmailStatus: location?.tenantEmailStatus ?? EmailStatus.Unverified,
|
||||
tenantEmailLanguage: location?.tenantEmailLanguage ?? (locale as "hr" | "en"),
|
||||
tenantPaymentMethod: location?.tenantPaymentMethod ?? "none",
|
||||
proofOfPaymentType: location?.proofOfPaymentType ?? "none",
|
||||
billFwdEnabled: location?.billFwdEnabled ?? false,
|
||||
@@ -426,6 +427,23 @@ export const LocationEditForm: FC<LocationEditFormProps> = ({ location, yearMont
|
||||
</fieldset>
|
||||
)}
|
||||
|
||||
<fieldset className="fieldset bg-base-200 border-base-300 rounded-box w-xs border p-4 pb-2 mt-4">
|
||||
<legend className="fieldset-legend font-semibold uppercase">{t("notification-language-legend")}</legend>
|
||||
<label className="label">
|
||||
<span className="label-text">{t("notification-language-label")}</span>
|
||||
</label>
|
||||
<select
|
||||
id="tenantEmailLanguage"
|
||||
name="tenantEmailLanguage"
|
||||
className="select input-bordered w-full"
|
||||
value={formValues.tenantEmailLanguage}
|
||||
onChange={(e) => handleInputChange("tenantEmailLanguage", e.target.value)}
|
||||
>
|
||||
<option value="hr">{t("notification-language-option-hr")}</option>
|
||||
<option value="en">{t("notification-language-option-en")}</option>
|
||||
</select>
|
||||
</fieldset>
|
||||
|
||||
<fieldset className="fieldset bg-base-200 border-base-300 rounded-box w-xs border p-4 pb-2 mt-4">
|
||||
<legend className="fieldset-legend font-semibold uppercase text-base">{t("scope-legend")}</legend>
|
||||
{!location ? (
|
||||
|
||||
Reference in New Issue
Block a user