Delay sending notification emails until signup round is done#11074
Merged
Delay sending notification emails until signup round is done#11074
Conversation
- Extract notification methods to Signup model for reusability - Implement send_notifications in ExecuteRankedChoiceSignupRoundService - Add nil check before calling send_notifications to handle rollback case - Suppress notifications in ExecuteRankedChoiceSignupService (parent service now handles them) - Add comprehensive tests for user confirmations and team member notifications 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Contributor
Code Coverage Report: Only Changed Files listed
Minimum allowed coverage is |
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR delays sending notification emails until after the ranked choice signup round transaction is complete, ensuring emails are only sent for successfully committed signups.
- Extracted notification methods to the Signup model for better reusability
- Modified ExecuteRankedChoiceSignupRoundService to send notifications after transaction completion
- Added comprehensive tests for notification behavior in ranked choice signup rounds
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| app/models/signup.rb | Adds reusable send_team_member_notifications and send_signup_confirmation_notification methods that delegate to notifier classes |
| app/services/execute_ranked_choice_signup_round_service.rb | Moves notifications outside the transaction block and adds send_notifications method to handle batch notification sending after successful signup processing |
| app/services/event_signup_service.rb | Refactors to use new Signup model notification methods instead of directly instantiating notifier classes |
| test/services/execute_ranked_choice_signup_round_service_test.rb | Adds comprehensive tests verifying user confirmations and team member notifications are sent correctly and can be suppressed |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Closes #11037.
Summary
Test plan
🤖 Generated with Claude Code