Skip to content

Delay sending notification emails until signup round is done#11074

Merged
nbudin merged 2 commits intomainfrom
nbudin/issue11037
Nov 13, 2025
Merged

Delay sending notification emails until signup round is done#11074
nbudin merged 2 commits intomainfrom
nbudin/issue11037

Conversation

@nbudin
Copy link
Copy Markdown
Contributor

@nbudin nbudin commented Nov 13, 2025

Closes #11037.

Summary

  • Extract notification methods to Signup model for reusability
  • Implement send_notifications in ExecuteRankedChoiceSignupRoundService
  • Add nil check before calling send_notifications to handle rollback case
  • Add comprehensive tests for user confirmations and team member notifications

Test plan

  • All existing tests pass
  • New tests verify user confirmation emails are sent
  • New tests verify team member notifications are sent based on preferences
  • New tests verify notifications can be suppressed

🤖 Generated with Claude Code

- 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>
@nbudin nbudin changed the title Add notification support to ranked choice signup round execution Delay sending notification emails until signup round is done Nov 13, 2025
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

Code Coverage Report: Only Changed Files listed

Package Coverage
Overall Coverage 🟢 30.86%

Minimum allowed coverage is 0%, this run produced 30.86%

@nbudin nbudin requested a review from Copilot November 13, 2025 18:15
@nbudin nbudin merged commit 928a34a into main Nov 13, 2025
21 checks passed
@nbudin nbudin deleted the nbudin/issue11037 branch November 13, 2025 18:16
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Delay sending emails until entire round runs

2 participants