Conversation
0184c9f to
975a78c
Compare
Simplify with guard clauses, replacing nested conditionals to reduce nesting depth and improve readability.
Allow mail from any source. De-duplication based on the message ID is already done by `InfoRequest#already_received?`. This change will make it easier to add support for ActionMailbox.
Now that mail source restriction have been dropped, the source argument threaded through RequestMailer.receive -> InfoRequest#receive. Clean up the dead parameter and its defaults.
This used to be assigned to Pro subscribers (and never removed if they unsubscribed). It was used when receiving inbound mails to allow emails delivered via the POP poller. Mail source restrictions have been removed so this feature can go too.
Retrieve the raw email source directly from the Mail object instead of using the inbound_email argument. The inbound_email value is threaded through multiple method calls, so relying on the Mail instance allows this parameter to be removed over time and simplifies the call chain.
The inbound_email was threaded through RequestMailer#receive -> InfoRequest#receive -> ResponseRejection but isn't used anymore beyond the initial parse into a Mail object. Remove it from every signature and call site.
Replace the generic *args / defaults hash pattern with explicit keyword arguments.
Change helper method so it doesn't return inbound_email anymore and combine with the actual call to receive the mail.
975a78c to
f524af8
Compare
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.
Relevant issue(s)
Work to support #8801
What does this do?
Refactors mail ingress so responses can be received from any source.
Why was this needed?
Requests used to be able to limiting responses received via
./script/mailinor the POP poller. This source criteria makes adding ActionMailbox integration harder (ie. we would need to patches). Luckily we are be able to remove the source limits without issue as we already check is a response has been received before adding it to a request.