Skip to content

Refactor rake notifications to use Notification model#4618

Open
CloCkWeRX wants to merge 1 commit intodevfrom
refactor-rake-notifications-3048820086930986872
Open

Refactor rake notifications to use Notification model#4618
CloCkWeRX wants to merge 1 commit intodevfrom
refactor-rake-notifications-3048820086930986872

Conversation

@CloCkWeRX
Copy link
Copy Markdown
Collaborator

This PR refactors the planting and harvest reminder notifications in growstuff.rake to use the Notification model instead of calling NotifierMailer.deliver_later directly.

Key changes:

  • Logic for identifying relevant plantings/harvests and generating notification content has been moved to a new ReminderService.
  • Reminders now create Notification records, ensuring they appear in users' on-site inboxes.
  • The Notification model triggers an email automatically via its after_create callback if the user has opted in.
  • A NotificationsHelper was added with a reply_link implementation to handle linking from emails to conversations or posts.
  • The Notification model now allows an optional notifiable association, facilitating aggregate reminders that don't point to a single object.
  • New tests ensure that the rake tasks correctly delegate to the service and that the service creates notifications on the appropriate days.

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

- Created ReminderService to handle reminder logic and Markdown generation
- Updated growstuff.rake to use ReminderService and create Notification records
- Implemented NotificationsHelper#reply_link for better email navigation
- Made Notification#notifiable optional to support system-wide reminders
- Added unit tests for ReminderService and rake tasks

Co-authored-by: CloCkWeRX <365751+CloCkWeRX@users.noreply.github.com>
@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.

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