Conversation
📝 WalkthroughWalkthroughThis PR removes per-treasurer email iteration and consolidates credit delivery reporting into a single mail sent to the configured treasurer email ( Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 3❌ Failed checks (1 warning, 2 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 🧹 Recent nitpick comments
Tip Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR refactors the credit delivery report email system to send notifications to a single configured email address (TREASURER_EMAIL) instead of iterating through all users with the treasurer role. This change reduces email duplication, prevents administrative accounts from receiving unnecessary notifications, and decouples notification recipients from user roles.
Changes:
- Removed the loop over
User.treasurerin favor of a single email to the configured treasurer address - Updated the
credit_delivery_report_mailmethod signature to remove thetreasurerparameter - Updated tests and mailer previews to reflect the new method signature
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| app/jobs/credit_insufficient_notification_job.rb | Simplified notification sending by removing the loop over treasurer users and sending a single email to the configured address |
| app/mailers/user_credit_mailer.rb | Removed the treasurer parameter and updated the email recipient to use Rails.application.config.x.treasurer_email |
| spec/jobs/credit_insufficient_notification_job_spec.rb | Removed the treasurer user fixture and updated the test to verify email is sent to the configured address |
| spec/mailers/previews/user_credit_mailer_preview.rb | Updated the preview to match the new method signature without the treasurer parameter |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## staging #1231 +/- ##
===========================================
- Coverage 77.61% 77.59% -0.02%
===========================================
Files 54 54
Lines 1407 1406 -1
===========================================
- Hits 1092 1091 -1
Misses 315 315 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary
Refactors credit delivery report emails to send to a single configured email address (TREASURER_EMAIL) instead of every user with the treasurer role.
Motivation
Previously, all users with the treasurer role received credit notification emails. This caused:
Administrative accounts to receive unnecessary emails
Which annoyed me a lot, so it needed to change :)
Changes
This fixes #442 (kinda)
Summary by CodeRabbit