Files
FOSSBilling/tests
Adam Daley d144dfdc07 Attach PDF invoices to invoice emails (#3913)
* Attach PDF invoices to invoice emails (#1724)

Adds generic file-attachment support to the email pipeline (Mail, QueuedEmail,
Email\Service) and wires it into invoice notifications via a new
"Attach PDF Copy to Invoice Emails" setting, so clients who pay by bank
transfer can view the invoice without logging in.

Also carries the same attachment into the sent-email activity log so a
later "resend" (client or admin) reattaches the PDF instead of dropping it.

* Address PR review: avoid blob hydration in email history list, fix checkbox uncheck

- ActivityClientEmailRepository::getSearchQueryBuilder() now selects a partial
  entity that excludes attachment_content, so the paginated admin/client email
  history list no longer hydrates every PDF into memory just to render
  has_attachment. Verified against a real Doctrine EntityManager that the DQL
  parses, the generated SQL excludes the blob column, and toApiArray() still
  works correctly on the partial entity.
- mod_invoice_settings.html.twig: add the hidden-input-before-checkbox pattern
  already used elsewhere in this codebase (e.g. mod_client_new_form.html.twig),
  so unchecking "Attach PDF Copy to Invoice Emails" actually persists as
  disabled instead of being silently dropped from the form submission.
2026-07-06 23:32:12 +01:00
..