feat: resend all button for missed posts/emails
Closes #1814
- #1814
- Link to Figma
This PR enables a user to resend all missed posts/emails using a single button. Missed posts can be furthere filtered by workflows using a Select box.
Changes
- The section title is changed from
Send Missed Poststo aSelectbox which allows you to filter missed posts by a workflow - When
Resend Allis clicked, a sidekiq job is triggered to send all of the missed emails - Business logic used for sending posts single/bulk is re-factored into
SendPostsForPurchaseServiceservice, which is then used throughout the code base. - Users who have opted out of receiving comms are not sent any emails for single/bulk resend paths
- There is an additional empty state which wasn't a part of the design presented inside the demo video. It's displayed when no missed posts are present (had to do this so users could switch properly between selected workflows)
Before
https://github.com/user-attachments/assets/7996a12c-6263-4e06-9862-b3d57afe5e1c
After
Screenshots
| Device | Light | Dark |
|---|---|---|
| Desktop | ||
| Mobile |
Demo
- Send all missed posts with emails (All the mails were delivered, attaching screenshots of a few)
Specs Passing
bundle exec rspec spec/policies/installment_policy_spec.rb spec/services/send_posts_for_purchase_service_spec.rb spec/requests/customers/customers_spec.rb:457 spec/sidekiq/send_missed_posts_job_spec.rb spec/controllers/posts_controller_spec.rb spec/policies/audience/purchase_policy_spec.rb spec/controllers/workflows_controller_spec.rb spec/presenters/workflow_presenter_spec.rb spec/presenters/workflows_presenter_spec.rb
AI Disclosure
- Cursor Ask Mode (Auto Model) for understanding code base
- Cursor Plan Mode + Build (Sonnet 4.5 + Composer) for initial draft
- Cursor Agent Mode (Auto) for co-ordinated edits + debugging
Live Stream Disclosure
- Have watched all four live streams
RFR! Please have a look @ershad 🙏
Thank you for the review 🙏
I'll address the concerns raised over here and raise a new PR