Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature | Notifications mechanism #69

Merged
merged 24 commits into from
Aug 7, 2024
Merged

Conversation

AlanSoto31
Copy link
Contributor

@AlanSoto31 AlanSoto31 commented Jul 26, 2024

Description

  • Implement a reminder system to notify users at specific intervals before an event begins. Initially, the reminders will be set for 15 minutes, 10 minutes, and at the event's start time.

  • Noticed gem setup.

  • Task

How has this been tested?

Please mark the tests that you ran to verify your changes. If difficult to test, consider providing instructions so reviewers can test.

  • Manual testing
  • System tests
  • Unit tests
  • None

Checklist

  • CI pipeline is passing
  • My code follows the conventions of this project
  • I have performed a self-review of my code
  • I have commented on my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (if applicable)
  • I have added seed data to the database (if applicable)

How to test

  1. Update the REMINDER_CANDENCE constant as below:
  REMINDER_CADENCE = {
    first_reminder: 2.minutes,
    second_reminder: 1.minute,
    last_reminder: 0.minutes
  }.
  1. Ensure User.last.profile.mail_notifications = true
  2. Run the code below to create some events for testing :
(1..6).each_with_index do |cadence, index|
  starts_at = Time.zone.now + cadence.minutes

  event = Event.create!(
    conference: Conference.last,
    title: "Event #{index + 1}",
    description: Faker::Lorem.paragraph,
    starts_at: starts_at,
    ends_at: (starts_at + 10.minutes),
    location: Location.last
  )

  event.users << User.last
end
  1. The email notifications for each event should be delivered like the table below
image

@AlanSoto31 AlanSoto31 marked this pull request as ready for review July 29, 2024 15:41
app/models/event/reminder_scheduler.rb Outdated Show resolved Hide resolved
app/notifiers/event_notifier.rb Outdated Show resolved Hide resolved
app/notifiers/event_notifier.rb Outdated Show resolved Hide resolved
app/models/event/reminder_scheduler.rb Outdated Show resolved Hide resolved
@AlanSoto31 AlanSoto31 requested a review from Sergio-e July 31, 2024 19:18
@AlanSoto31 AlanSoto31 requested a review from Sergio-e August 3, 2024 01:30
@LuigiR0jas LuigiR0jas removed their request for review August 7, 2024 15:41
@Sergio-e Sergio-e merged commit e0f0f80 into main Aug 7, 2024
4 checks passed
@Sergio-e Sergio-e deleted the feature/notifications-mechanism branch August 7, 2024 17:57
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.

3 participants