ForwardEmail.net support#10597
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for ForwardEmail.net by introducing a new service and job to handle email forwarding, as well as integrating email forwarding sync callbacks into various models. Key changes include:
- Adding the SyncForwardEmailService to handle API interactions with ForwardEmail.net.
- Implementing email forwarding sync callbacks in TeamMember, StaffPosition, Event, EmailRoute, and Convention models.
- Enhancing EmailForwardingRouter with Mapping and MappingSet to consolidate email route mappings.
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| app/services/sync_forward_email_service.rb | New service to connect and synchronize domains and aliases with ForwardEmail.net, with a potential loop condition issue in pagination. |
| app/services/email_forwarding_router.rb | New Mapping and MappingSet classes to assemble email forwarding mappings; potential missing implementation for keys method. |
| app/models/team_member.rb | Added after_commit callback to trigger email forwarding sync. |
| app/models/staff_position.rb | Added after_commit callback; potential issue with referencing an undefined association. |
| app/models/event.rb | Added after_commit callback for email forwarding sync. |
| app/models/email_route.rb | Added after_commit callback for email forwarding sync with improved normalization methods. |
| app/models/convention.rb | Updated callback to conditionally trigger email forwarding sync on multiple domain/setting changes. |
| app/jobs/sync_email_forwarding_for_domain_job.rb | New job to trigger synchronization using the service. |
| Gemfile | Added Faraday gem to support HTTP connections. |
| .merge(all_email_route_mappings) | ||
| end | ||
|
|
||
| def self.all_inbound_addresses |
There was a problem hiding this comment.
MappingSet instances do not implement a 'keys' method; consider delegating 'keys' to the underlying mappings hash or adjusting the method accordingly.
| end | ||
|
|
||
| def sync_email_forwarding | ||
| SyncEmailForwardingForDomainJob.perform_later(EmailRoute.normalize_domain(convention.domain)) |
There was a problem hiding this comment.
The method references 'convention', which is not defined on StaffPosition; consider using the associated 'catch_all_convention' if that was the intended source.
| SyncEmailForwardingForDomainJob.perform_later(EmailRoute.normalize_domain(convention.domain)) | |
| domain = convention&.domain || catch_all_convention&.domain | |
| return unless domain | |
| SyncEmailForwardingForDomainJob.perform_later(EmailRoute.normalize_domain(domain)) |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Code Coverage Report: Only Changed Files listed
Minimum allowed coverage is |
Suspect IssuesThis pull request was deployed and Sentry observed the following issues:
Did you find this useful? React with a 👍 or 👎 |
No description provided.