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

Add NotificationPreference for weekly reminder #1867

Merged
merged 8 commits into from
Jul 10, 2024

Conversation

nisusam
Copy link
Contributor

@nisusam nisusam commented Jun 19, 2024

  • Fix Disable emails by default #1863
  • By default, preference is set to false
  • After this PR got merged, we need to run a one-off script to generate NotificationPreference records

- Fix #1863
- By default, preference is set to `false`
- After this PR got merge, need to run one-off script to generate
  NotificationPreference records
Nishant Samel added 5 commits June 26, 2024 11:45
- Fix styling for desktop and mobile screens
- Use ReminderIcon(Bell Ringing Icon) for notification
- Use CustomToggle instead of Checkbox for enable/disable notification
Copy link
Contributor

@gowsik-ragunath gowsik-ragunath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, left few comments and suggestions.

app/models/company.rb Outdated Show resolved Hide resolved
app/models/user.rb Outdated Show resolved Hide resolved
Comment on lines +11 to 16
notification_preference = NotificationPreference.find_by(user_id: user.id, company_id: company.id)

if notification_preference.present? && notification_preference.notification_enabled
check_entries_and_send_mail(user, company)
end
end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: I think it would be better if we have this check in SendWeeklyReminderToUserMailer, so that even when we trigger mailer manually, it won't send any email if the user's notification preference is not satisfied.

In future, we can even have this as a before action check in the application mailer, If we plan to use this notification preference for all the mail notifications.

app/models/notification_preference.rb Outdated Show resolved Hide resolved
@apoorv1316 apoorv1316 merged commit a619b54 into develop Jul 10, 2024
1 check passed
@apoorv1316 apoorv1316 deleted the notification_preferences branch July 10, 2024 05:45
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.

Disable emails by default
3 participants