Skip to content

Add Harvest Reminder Emails and Scheduled Task - #4604

Merged
CloCkWeRX merged 1 commit into
devfrom
harvest-reminders-16703221337897327633
May 2, 2026
Merged

CloCkWeRX merged 1 commit into
devfrom
harvest-reminders-16703221337897327633

Conversation

@CloCkWeRX

Copy link
Copy Markdown
Collaborator

This PR implements a new notification system to remind members of upcoming harvests in their garden.

Key Changes:

  • Member Preference: Added a send_harvest_reminder boolean column to the members table (default: true).
  • Settings UI: Added a checkbox in the Email settings page for members to opt-out of harvest reminders.
  • Harvest Prediction: Added harvest_in_next_week? to PredictHarvest concern, which identifies plantings predicted to be ready for harvest within the next 7 days that haven't been harvested yet.
  • Mailer: Added harvest_reminder to NotifierMailer with localized HAML templates.
  • Scheduled Task: Added growstuff:send_harvest_reminders Rake task, configured to run logic on Wednesdays (Heroku Scheduler pattern).
  • Bug Fix & Scalability: Updated reminder tasks to use deliver_later and fixed a typo where Notifier was used instead of NotifierMailer in an existing task.

Testing:

  • Added spec/models/harvest_prediction_spec.rb to verify prediction logic.
  • Added spec/mailers/harvest_reminder_mailer_spec.rb to verify email generation.
  • Verified preference saving and Rake task logic via Rails runner.
  • Performed frontend verification of the settings checkbox.

PR created automatically by Jules for task 16703221337897327633 started by @CloCkWeRX

- Added `send_harvest_reminder` preference to Member model and settings UI.
- Implemented `harvest_in_next_week?` in PredictHarvest concern.
- Created `harvest_reminder` email with localized templates.
- Added `growstuff:send_harvest_reminders` Rake task to run weekly.
- Refactored existing and new reminder tasks to use `deliver_later` for scalability.
- Added unit tests for prediction logic and mailer.
- Fixed a bug in the existing planting reminder task where it was using an uninitialized constant `Notifier`.

Co-authored-by: CloCkWeRX <[email protected]>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@CloCkWeRX
CloCkWeRX merged commit 2380c66 into dev May 2, 2026
16 checks passed
@CloCkWeRX
CloCkWeRX deleted the harvest-reminders-16703221337897327633 branch May 2, 2026 06:16
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.

1 participant