Send PocketBase's auth emails in the recipient's language

PocketBase keeps one set of email templates on the users collection, so
before docwell-server asks it for a verification, password-reset or
magic-link email, the new authmail package writes the templates in the
recipient's language (stored locale, else the request's), one send at a
time. Adds Polish, German, French and Spanish templates; English stays in
the schema snapshot. New-login alerts use the language written last.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
tajniak81andClaude Opus 5.5 committed 2026-11-17 11:39:58 +01:00
1 parent cad42fbe89
commit 7f09338b60
13 files changed
+570 -5

No files matched your search

+4 -1
View File
@@ -6,7 +6,10 @@ docwell-db is a stock [PocketBase](https://pocketbase.io): the stack runs
docwell-server brings PocketBase up to Docwell's schema itself, every time it starts
([`Server/internal/pbschema`](../Server/internal/pbschema/pbschema.go)): missing collections and fields are created,
existing ones keep their data. It also writes the `DOCWELL_*` settings (app name and URL, mail, file storage) and
sends Docwell's own emails, so PocketBase needs no hooks either.
sends Docwell's own emails, so PocketBase needs no hooks either. PocketBase's auth emails (verification, password
reset, magic link) use the templates on `users`; docwell-server rewrites them in the recipient's language before
each send ([`Server/internal/authmail`](../Server/internal/authmail/authmail.go)), so edits made to them in the
PocketBase dashboard do not last.
This folder is where that schema is written: