Skip to content

feat: per-signer language for e-mails - #9549

Open
no84by wants to merge 2 commits into
LibreSign:mainfrom
no84by:feat/signer-mail-language
Open

no84by wants to merge 2 commits into
LibreSign:mainfrom
no84by:feat/signer-mail-language

Conversation

@no84by

@no84by no84by commented Nov 18, 2026 •

Copy link
Copy Markdown

Resolves: #9546, #6441

Summary

Let the requester choose, per signer, the language of the e-mails LibreSign sends to that participant (invitation, change/reminder, cancellation). Default behaviour is unchanged: without a choice the e-mails use the default language as today.

  • New optional signer field language (a language code LibreSign ships translations for), stored in the sign request metadata (metadata.language), no schema change.
  • MailService builds those e-mails with IFactory::get(libresign, $language) and calls IEMailTemplate::setLanguage(), so the footer and the HTML lang/dir follow the same language.
  • Absent key keeps the stored value, empty value clears it, unknown code is rejected with "Invalid language".
  • Request page: an "E-mail language" select in the signer editor ("Default language" first, then the available languages named via Intl.DisplayNames). Codes come from the new signer_languages initial state (main page and Files sidebar).
  • The "document signed" mail is not touched: it goes to the requester, not to the signer. The sign code mail is also unchanged.

How to test

  1. Create a request, add an e-mail signer, pick a language other than yours under "E-mail language", send.
  2. The invitation arrives in that language (subject, body, button, footer).
  3. Edit the signer: the select shows the stored language. Set it back to "Default language": the next mail uses the default language again.
  4. API: language: "xx" on a signer returns "Invalid language".

Validation evidence

  • Focused regression/acceptance test: PHPUnit SignerLanguageServiceTest, MailServiceTest, SignerValidatorTest, RequestSignatureServiceTest, TemplateLoaderTest; integration PageControllerTest; Vitest IdentifySigner.spec.ts, files.spec.ts
  • Relevant lint/type/static-analysis checks: php-cs-fixer, eslint, lint:translator-hints, vue-tsc
  • Broader suite required by the changed surface: full PHPUnit unit suite, full Vitest suite
  • CI reviewed

UI / Front-end changes

  • New "E-mail language" select in the signer editor
  • Screenshots before/after added for user-visible changes
Before After
Screenshot before Screenshot after
  • Component/unit (Vitest) tests added or updated

API / Back-end changes

  • Optional language on NewSigner; language in SignerMetadata
  • Unit and/or integration tests added or updated
  • Negative paths checked (unknown code, non-string value)
  • API documentation regenerated with composer openapi

Checklist

  • I have read and followed the contribution guide.
  • The diff does not contain unrelated refactors or generated changes.
  • Commits follow Conventional Commits where applicable.
  • All commits include the required DCO sign-off.

AI (if applicable)

  • The content of this PR was partially or fully generated using AI

A signer can carry an optional `language` (a language code LibreSign has
translations for). It is stored in the sign request metadata and used for
the invitation, change/reminder and cancellation e-mails sent to that
participant, including the footer and the HTML lang/dir attributes.
Without a value the e-mails keep using the default language.

An absent key keeps the stored language, an empty value clears it and an
unknown code is rejected. The available codes are provided to the request
page as the `signer_languages` initial state.

Signed-off-by: no84by <50858621+no84by@users.noreply.github.com>
Add an "E-mail language" select to the signer editor on the request page.
It lists the languages LibreSign ships translations for, named in the
language of the requester, with "Default language" first. The select is
shown only when the participant receives e-mails and more than one
language is available. The chosen value is sent as the signer `language`
field and restored from the signer metadata when editing.

Signed-off-by: no84by <50858621+no84by@users.noreply.github.com>
@no84by
no84by requested a review from a team as a code owner November 18, 2026 13:34
@welcome

welcome Bot commented Nov 18, 2026

Copy link
Copy Markdown

Thanks for opening your first pull request in this repository! ✌️

@no84by

no84by commented Nov 18, 2026

Copy link
Copy Markdown
Author

Screenshots (test instance on main 7a8403d vs this branch, light and dark theme):

Add-signer dialog: "E-mail language" select

Before (light) After (light)
before after
Before (dark) After (dark)
before after

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Per-signer language for e-mails Make email text and footer language configurable

1 participant