Skip to content

Feature/organizer comment notification toggle#68

Merged
zhouyijun111 merged 2 commits into
mainfrom
feature/organizer-comment-notification-toggle
Apr 22, 2026
Merged

Feature/organizer comment notification toggle#68
zhouyijun111 merged 2 commits into
mainfrom
feature/organizer-comment-notification-toggle

Conversation

@zhouyijun111
Copy link
Copy Markdown

What this PR does

This PR adds an organizer-level toggle to control whether “proposal comment” notification emails are sent to organizers.

Changes

  • Database: Added users_roles.email_notifications (default: enabled).
  • Admin UI: Added an “Email notifications” switch on the conference organizer users list (AJAX-backed).
  • Backend: Implemented Admin::RolesController#toggle_comment_notifications to persist the preference.
  • Authorization: Updated AdminAbility to allow the toggle action.
  • Email delivery: Updated the comment-notification recipient scope so organizer users only receive emails when email_notifications = true.
  • Frontend: Improved osem-switch.js handling to prevent incorrect auto-triggering during initialization/cache restore.

Test plan

  1. Go to the admin page for a conference and open the organizer user list.
  2. Toggle “Email notifications” to No.
  3. Create a new proposal comment.
  4. Verify in letter_opener that no email is sent to that organizer.
  5. Toggle “Email notifications” back to Yes.
  6. Create another proposal comment.
  7. Verify in letter_opener that an email is sent.

Screenshot

image

@hagenhaeussler
Copy link
Copy Markdown

hagenhaeussler commented Apr 10, 2026

Looks good, but I don't see all too many tests here :) Maybe add some.

…ment-notification-toggle

Made-with: Cursor

# Conflicts:
#	db/schema.rb
@zhouyijun111
Copy link
Copy Markdown
Author

previous merge conflict solved

@zhouyijun111 zhouyijun111 merged commit 0b47097 into main Apr 22, 2026
11 of 17 checks passed
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.

2 participants