Give every email a full legal footer (Anbieterkennzeichnung), not just a company line

Order confirmation, resend-verification, and the internal critical-alert
mail now render name, street, ZIP/city, email, and VAT ID from
company-settings instead of a bare "<sellerName> · <sellerEmail>" line,
so every email this app sends meets business-correspondence footer
requirements rather than just the customer-facing ones.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Marco
2026-07-22 14:15:43 +00:00
parent a801d41d79
commit e61a62e579
6 changed files with 119 additions and 43 deletions
+22 -10
View File
@@ -641,16 +641,28 @@ mechanism as Posts/LegalPages/Testimonials (`useLivePreview()` from
option here). Not shared code with the React page — this is plain
inline-styled HTML built for email-client compatibility (nested
`<table>`s, no flexbox) — just matched by eye.
- **Footer company line is configurable, not hardcoded.** `emailShell()`
takes a required `companyLine` parameter ("<sellerName> · <sellerEmail>")
`orderEmail.ts` fetches `company-settings` once (`getSellerForInvoice()`)
and derives it from there, same admin-editable business data the invoice
PDFs already use, rather than a literal `"einfach produktiv ·
admin@mk360.de"` string. The Payload-side sends (password-reset, the 4
status-change emails, verification) do the same via that repo's
`src/lib/sellerInfo.ts`. Live Preview uses `DEFAULT_COMPANY_LINE` (a
fallback constant) since there's no real order/tenant context there to
fetch against.
- **Footer carries a full legal Anbieterkennzeichnung, not just a brand
line.** `emailShell()` takes a `footerLines: string[]` array built by
`buildLegalFooterLines(seller)``sellerName`, `sellerStreet`,
`sellerZip`/`sellerCity` (+ `sellerCountry` if not Germany), `E-Mail:
sellerEmail`, and `USt-IdNr.: vatId` when set — the same admin-editable
`company-settings` fields the invoice PDFs already use, rather than a
literal `"einfach produktiv · admin@mk360.de"` string. `orderEmail.ts`
and `alertAdmin.ts` (both the resend-verification mail and the plain-text
critical-alert mail) all fetch `company-settings` once
(`getSellerForInvoice()`) and pass the `seller` object straight into the
render functions, which call `buildLegalFooterLines()` themselves — one
place composes the footer, not each call site. The Payload-side sends
(password-reset, the 4 status-change emails, the *initial* verification
email) need the equivalent treatment via that repo's own
`src/lib/sellerInfo.ts`, not present in this checkout. Live Preview passes
`seller: null`, which falls back to `DEFAULT_LEGAL_FOOTER_LINES` (a
placeholder Anbieterkennzeichnung) since there's no real order/tenant
context there to fetch against. Note `company-settings` currently has no
Handelsregister court/number or Geschäftsführer field — fine for a sole
proprietorship, but would need adding if the business becomes a
registered legal form (GmbH etc.), see that collection's own field list
above.
### GDPR self-service