Add automated reminder for queue items without ticket (#10175)#11189
Open
Add automated reminder for queue items without ticket (#10175)#11189
Conversation
9170425 to
1b3c19d
Compare
Refactored RemindDraftEventProposalsJob into a general SendRemindersJob that sends multiple types of reminders. Added new functionality to remind users who have items in their signup queue but no ticket (only for conventions where tickets are required). Changes: - Renamed RemindDraftEventProposalsJob to SendRemindersJob - Created RemindQueueWithoutTicket service to find users needing reminders - Added queue_no_ticket_reminded_at timestamp to user_con_profiles table - Added signup_queue/no_ticket_reminder notification type to config - Created SignupQueue::NoTicketReminderNotifier for email delivery - Added SignupRankedChoiceUserConProfileEvaluator dynamic destination - Updated RunNotificationsService to use new job name - Fixed pre-existing rubocop issue in notifier DSL The service finds users who: - Have pending items in their signup queue - Don't have a ticket - Are in a convention where tickets are required - Haven't been reminded in the last week Reminders are sent automatically when the SendRemindersJob runs (daily via RunNotificationsService). Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1b3c19d to
e620c1a
Compare
The signup_queue/no_ticket_reminder notifier requires a user_con_profile parameter, which needs to be handled by the preview factory for integration tests. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
The evaluator now takes a signup_ranked_choice parameter and extracts the user_con_profile from it, consistent with other evaluators like SignupUserConProfileEvaluator and OrderUserConProfileEvaluator. Updated: - SignupRankedChoiceUserConProfileEvaluator to accept signup_ranked_choice - SignupQueue::NoTicketReminderNotifier to accept signup_ranked_choice - RemindQueueWithoutTicket service to pass first pending signup_ranked_choice - NotifierPreviewFactory to handle signup_ranked_choice parameter Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Instead of finding UserConProfiles and then searching for their signup_ranked_choices, the service now queries SignupRankedChoices directly and uses DISTINCT ON to get one per user. This is more efficient and aligns better with the notifier's interface. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Updated RemindQueueWithoutTicket to: - Send reminders only once (no repeat reminders) - Send exactly one week before the first signup round with automated signups - Only apply to conventions using ranked_choice signup automation - Use BETWEEN clause to match signup rounds in the reminder window Updated tests to: - Create signup rounds with automation_action and ranked_choice_order - Verify reminder is not sent when already reminded - Add test for when signup round is not in reminder window - Update convention to use signup_automation_mode: 'ranked_choice' Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Moved the signup_rounds filtering from .joins to .where clauses, which provides cleaner native parameter binding with ? placeholders. The join now only establishes the relationship, while all filtering happens in .where clauses. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Previously, only tests asserting that emails were sent used perform_enqueued_jobs. Tests asserting no emails were sent didn't actually process the job queue, so they could accidentally pass even if emails would have been sent. Now all tests consistently use perform_enqueued_jobs to ensure the job queue is processed and assertions are properly validated. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Contributor
Code Coverage Report: Only Changed Files listed
Minimum allowed coverage is |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements #10175 - Adds automated email reminders for users who have items in their signup queue but haven't purchased a ticket yet (only for conventions where tickets are required).
Also refactors the reminder system to be more general by combining
RemindDraftEventProposalsJobinto a newSendRemindersJobthat can handle multiple types of reminders.Changes
Refactored Reminder System
RemindDraftEventProposalsJobtoSendRemindersJobRunNotificationsServiceto use the new job nameRemindDraftEventProposals(existing functionality)RemindQueueWithoutTicket(new functionality)New Queue Reminder Feature
RemindQueueWithoutTicket- finds users who need remindersSignupQueue::NoTicketReminderNotifier- handles email deliveryqueue_no_ticket_reminded_attimestamp touser_con_profilessignup_queue/no_ticket_remindernotification typeSignupRankedChoiceUserConProfileEvaluatorfor targetingReminder Criteria
The service finds and reminds users who:
ticket_modeisrequired_for_signuporticket_per_eventEmail Template
The notification template needs to be configured per-convention in the admin interface at
/admin_notifications. The template has access to:user_con_profile- the user's convention profileticket_name- the convention's word for "ticket"queue_items- array of pending signup ranked choicesScheduling
Reminders are sent automatically when
SendRemindersJobruns, which is triggered daily byRunNotificationsService.Test Plan
ticket_modeset torequired_for_signupSendRemindersJob.perform_nowand verify email is sentqueue_no_ticket_reminded_atis set on the user profileNotes
🤖 Generated with Claude Code