Schedule Reminders task for Events fail to complete when Event tokens used in combination with "Also include" Contacts
Overview
When Scheduled Reminders are set up for an Event in CiviCRM, and the content of that email includes Tokens relating to the Event (Event Title, Start Date, etc.) AND the user includes additional Contacts to include in the Scheduled Reminder (in the "Also include" field), this breaks the Scheduled Reminder scheduled task, and it fails to complete.
Reproduction steps
- From an event, set up a Scheduled Reminder to send based on the Event, i.e. 24 hours before the Start Date
- In the body content of the Scheduled Reminder email, include one or more Tokens related to the Event (Event Title, Event Start Date)
- In the "Limit or Add Recipients" field for the Scheduled Reminder "Also include" a Contact who is NOT registered as a Participant for the given event
Current behaviour
When the scenario above is in place, Scheduled Reminder task trigger by the CiviCRM Cron starts to fail and not complete.
Expected behaviour
Scheduled Reminder tasks should continue to run, complete and include the additional Contacts in the Reminder email as well as the Event Participants.
Environment information
- CiviCRM: 5.64.4
- PHP: 7.4/8.0_
- CMS: WordPress 6.4.3
Comments
Tested and reproduced on production site and on a clean Civi+WP site using CiviBuild in test CiviCRM site.