-
Notifications
You must be signed in to change notification settings - Fork 75
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
Conversation
- Fix #1863 - By default, preference is set to `false` - After this PR got merge, need to run one-off script to generate NotificationPreference records
- Fix styling for desktop and mobile screens - Use ReminderIcon(Bell Ringing Icon) for notification - Use CustomToggle instead of Checkbox for enable/disable notification
…cept the invitaton
There was a problem hiding this 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.
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 |
There was a problem hiding this comment.
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.
false
NotificationPreference
records