Event Registration Reminder issues

Created on 8 August 2024, about 1 year ago

Problem/Motivation

We are using recurring events registration and recurring events registration reminders submodules. I have noted two issues and I'm not sure why we're seeing what we're seeing:
1. An event series is created with registration reminders turned on. Next, an event instance is created. Until the event series' registration reminders schedule is changed, the event instance's reminder_date stays null.

2. If the event series' reminder registration schedule is changed (e.g. from '1 day' to '2 days'), ALL event instances have their 'reminder_sent' value set to 'NULL' which means past events will receive reminder emails.

Steps to reproduce

- Create a new event series
- Enable regisration, and registration reminders.
- Create an event instance
- Note that the table 'eventinstance_field_data' has 'reminder_date' equal to null
- Update the event series and change the registration reminder schedule
- Note that 'eventinstance_field_data' now has 'reminder_date' set, but for ALL instances, even those in the past, 'reminder_sent' is null.

Proposed resolution

I'm not sure how best to approach the first issue. The second is fairly straightforward - it should validate against the event end date before setting the 'reminder_sent' to null.

πŸ› Bug report
Status

Active

Version

2.0

Component

Recurring Events Reminders (Submodule)

Created by

πŸ‡ΊπŸ‡ΈUnited States phillamb168

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @phillamb168
  • πŸ‡ΊπŸ‡ΈUnited States nm63282 Seattle, WA

    Thanks your clear write up and for the report @phillamb168. I can reproduce the same, although it sounds like you found workarounds.

    Here's my write up to help drafting a pull request. I should be able to draft something shortly.

    1) Clicking Add instance on a series creates an instance with `reminder_date` empty
    2) When `reminder_date` changes `reminder_sent` is emptied
    3) If series dates changes but reminder options did not, instances are recreated without a `reminder_date` (It's expected Instances are recreated when series dates change)

  • πŸ‡ΊπŸ‡ΈUnited States nm63282 Seattle, WA

    I've attached a patch that address the issues and is pretty minimal. But recurring_events can be heavily relied on and by sites with lots of events traffic so it'd be helpful getting review from another maintainer.

    Here a summary of the changes, which are within recurring_Events_registration:

    1. Change hook `eventseries_insert` to `eventinstance_insert`
    2. Change criteria in `eventseries_update` to simple yes/ no
    3. Do not empty `reminder_sent`

    I'll mark this as Needs review.

  • πŸ‡ΊπŸ‡ΈUnited States nm63282 Seattle, WA
  • πŸ‡¨πŸ‡΄Colombia camilo.escobar

    Hello @ ll66382 and @phillamb168.

    I understand the two issues raised here, although my comment will focus exclusively on issue #2.

    The functionality for sending multiple reminders for an event (by updating the reminder settings in an event series - for example, initially scheduling a reminder for "1 month before" and later adding a new reminder for "1 day before") was introduced in #3283237 β†’ .

    While this feature is valuable, an important detail was overlooked: only future event instances should be marked for sending new reminders. That is exactly what issue #2 here reports, and I agree it makes total sense.

    However, I believe the solution implemented for issue #2 in the provided patch is incorrect.

    In the original code, recurring_events_reminders_eventseries_update properly checked that reminder settings had actually changed by comparing reminder_amount and reminder_units between the original and the updated entity:

        if ($original->registration_reminders->reminder_amount !== $entity->registration_reminders->reminder_amount
          || $original->registration_reminders->reminder_units !== $entity->registration_reminders->reminder_units
        ) {
                ...
    

    The patch removes this evaluation, which means that any change to the event series - or even simply saving it without modifications - will update the reminder_date and reminder_sent values for all event instances, marking them to send reminders. This creates a new and more severe bug than the one originally reported.

    The correct approach should be to retain the check for changes in the reminder settings, and then update reminder_date and reset reminder_sent (NULL) only for instances with future dates.

    For that reason, I have created a separate issue specifically describing and resolving #2: Issue 3545215 πŸ› Reminder settings update triggers notifications for past event instances Active .

    Recommendations for this issue:

    1. Limit this case so it addresses only problem #1.
    2. Remove references to issue #2, since that is now covered properly in #3545215 πŸ› Reminder settings update triggers notifications for past event instances Active .
    3. Update the title to make it more descriptive of the actual problem. The current one is too generic and does not help other developers quickly understand or find the issue.
    4. Provide a new patch or merge request that fixes only issue #1. The current patch should be hidden.
Production build 0.71.5 2024