Skip to content

Commit

Permalink
add YiR notif task
Browse files Browse the repository at this point in the history
  • Loading branch information
drusepth committed Jan 1, 2024
1 parent c5a69b2 commit a67c9ae
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lib/tasks/one_off.rake
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,21 @@ namespace :one_off do
end
end
end

desc "Year in Review notification"
task year_in_review_notification: :environment do
year = DateTime.current.year

User.find_each do |user|
user.notifications.create(
message_html: "<div>Your #{year} Year in Review is now available!</div><div class='blue-text text-darken-3'>Look back on your year on Notebook.ai.</div>",
icon: 'event',
icon_color: 'blue',
happened_at: DateTime.current,
passthrough_link: Rails.application.routes.url_helpers.review_year_path(year)
)
end
end

desc "Create a notification for all users telling them about the new notifications"
task notifications_announcement: :environment do
Expand Down

0 comments on commit a67c9ae

Please sign in to comment.