Repository navigation
feat(filinq): build letter-email-sending - #2192
Open
rubenvdlinde wants to merge 2 commits into
Open
rubenvdlinde wants to merge 2 commits into
rubenvdlinde wants to merge 2 commits into
Conversation
Send a composed letter by email: POST api/correspondence/send composes the letter as an email, attaches the PDF of the same letter when asked, sends it through Nextcloud's mailer to the address on the recipient object and logs one correspondence entry (sent with sentAt, sentTo and sentBy, or failed with the reason). A recipient the caller cannot read is a 404, a recipient without an address or an instance without a mail server a 422, before anything is composed. The Correspondence page gets a Send by email button and a confirm dialog that previews the address and subject. Assisted-by: ClaudeCode:claude-opus-5-5
rubenvdlinde
requested review from
Rem-Dam,
SudoThijn,
WilcoLouwerse,
bbrands02,
remko48 and
rjzondervan
as code owners
November 17, 2026 15:18
Conflicts only in the app version and the register description; both lines' schemas kept, register bumped to 8.74.0. Assisted-by: ClaudeCode:claude-opus-5-5
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Builds
openspec/changes/letter-email-sending: an officer can send a composed letter by email, and the send is recorded.Tasks done
CorrespondenceService::compose()is the composing half ofgenerate()(generate()still logs as before), andlogSent()writes the send's entry.CorrespondenceSendService::send()reads the recipient, composes the email body (and, when asked, the PDF of the same letter), sends throughIMailerand logs one correspondence entry:sentwithsentAt,sentToandsentBy, orfailedwith the reason. Schemacorrespondence1.4.0 (sentstatus, three fields), register 8.73.0, app version moved.null, gets 422 with a message that names the cause. If the mailer throws or refuses the address, the send is logged asfailedand the route answers 502 with a plain sentence and no server details. Routescorrespondence#sendandcorrespondence#sendPreview(#[NoAdminRequired]) are added toopenapi.json.src/dialogs/CorrespondenceSendDialog.vue. The dialog asks the preview route for the address and subject (it gives the same refusals as a send) and has a PDF checkbox. On confirm, the store'ssendByEmail()sends and the page shows "Sent to {address}". A refused send keeps the dialog open with the reason.Tasks left, and why
EmailLinkService::linkEmail(LinkTarget, EmailMessageRef)). A message sent throughIMailerhas neither, so there is nothing to link. The send does not touch the leaf, which is the absent-leaf behaviour the task's criterion asks for. Linking needs either sending through the Mail app or an OpenRegister link type for outbound mail.Tests added
tests/unit/Service/CorrespondenceServiceSendTest.php(10): runs the realCorrespondenceServiceandCorrespondenceSendServiceover a doubled mailer, object store and renderer. Covers one message to the address with the composed body, onesententry with who and when, the PDF attachment, no address (422), unreadable recipient (404, nothing composed), failing read, no recipient (400), no mail server (422), a mailer that throws (failedwith the reason), a refused address, and the preview. Mutation check: dropping the mail-server guard makestestNoMailServerIsRefusedfail.tests/unit/Controller/CorrespondenceControllerSendTest.php(7): 201, 502, 422, 404, 401, the preview, and the route attributes.src/dialogs/CorrespondenceSendDialog.spec.js(6) andsrc/store/modules/correspondence.spec.js(4).Suite
CorrespondenceServiceare the sameObjectSaveOptions/ObjectFindTargetstub errors development has.check:schema-l10n: 318 uncovered strings on development and 318 on this branch, so this change adds none. All new UI and schema strings are in en and nl.Generated by Claude Code