feat(inbound): InboundEmailService orchestrates reply/create + wire into controller#29
Open
mpge wants to merge 1 commit intofeat/mailgun-inbound-parserfrom
Open
feat(inbound): InboundEmailService orchestrates reply/create + wire into controller#29mpge wants to merge 1 commit intofeat/mailgun-inbound-parserfrom
mpge wants to merge 1 commit intofeat/mailgun-inbound-parserfrom
Conversation
…nto controller Closes the last missing piece of the inbound webhook loop for Spring. Mirrors the .NET reference (#26). Flow (per inbound POST): parser → InboundMessage → InboundEmailService.process(message) → InboundEmailRouter.resolveTicket - ticket found → TicketService.addReply(...) → REPLIED_TO_EXISTING - none + noise → SKIPPED (no-reply@sns.amazonaws.com, empty body+subject) - none + content→ TicketService.create(subject, body, guestName, guestEmail, MEDIUM) → CREATED_NEW ProcessResult carries: - outcome (REPLIED_TO_EXISTING | CREATED_NEW | SKIPPED) - ticketId / replyId - pendingAttachmentDownloads — provider-hosted attachment URLs (Mailgun) that a follow-up worker fetches + persists out-of-band. Empty when all attachments came inline (Postmark). Controller response expanded from { status, ticketId } to: { outcome, ticketId, replyId, pendingAttachmentDownloads } No tests yet in this commit — they require @SpringBootTest setup with a TicketService fake; follow-up PR will add them matching the .NET xUnit coverage.
This was referenced Apr 24, 2026
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.
Summary
Closes the last missing piece of the inbound webhook loop for Spring. Mirrors the .NET reference (escalated-dotnet #26).
Flow (per inbound POST)
ProcessResult
Java
recordcarrying:outcome(REPLIED_TO_EXISTING|CREATED_NEW|SKIPPED)ticketId/replyIdpendingAttachmentDownloads— provider-hosted attachment URLs (Mailgun) that a follow-up worker fetches + persists out-of-band. Empty when all attachments came inline (Postmark).Controller response
Expanded from
{ status, ticketId }to:{ "outcome": "replied_to_existing", "ticketId": 42, "replyId": 99, "pendingAttachmentDownloads": [...] }Dependencies
feat/mailgun-inbound-parser). Merge order: feat(email): add MessageIdUtil for RFC 5322 threading + signed Reply-To #24 → feat(email): wire MessageIdUtil into EmailService outbound headers #25 → feat(inbound): scaffold InboundMessage + InboundEmailParser + InboundEmailRouter #26 → feat(inbound): PostmarkInboundParser + InboundEmailController #27 → feat(inbound): MailgunInboundParser #28 → this PR.Test plan
InboundEmailService.process(reply / create / skip paths) — follow-up PR once the@SpringBootTestsetup is added. .NET reference tests are at escalated-dotnet feat(inbound): scaffold InboundMessage + InboundEmailParser + InboundEmailRouter #26 and can be ported 1:1.