CiviMail - Find and fix any missing recipients - #36430
Open
colemanw wants to merge 1 commit into
Open
Conversation
|
🤖 Thank you for contributing to CiviCRM! ❤️ We will need to test and review this PR. 👷 Introduction for new contributors...
PR commands & links...
|
seamuslee001
reviewed
Aug 6, 2026
| WHERE mr.mailing_id = %1 | ||
| AND queue.email_id IS NULL AND queue.phone_id IS NULL | ||
| AND (mr.email_id > 0 OR mr.phone_id > 0) | ||
| AND mr.contact_id > 0 |
Contributor
There was a problem hiding this comment.
should add mj.is_test = 0 and I would also just flag that we might need to join onto contact becuase when the jobs queue items it calls this function https://github.com/civicrm/civicrm-core/blob/master/CRM/Mailing/BAO/MailingJob.php#L423 which does a final check in case a contact has opted out since the mailing started running https://github.com/civicrm/civicrm-core/blob/master/CRM/Mailing/BAO/MailingRecipients.php#L62
seamuslee001
reviewed
Aug 6, 2026
| LEFT JOIN ( | ||
| SELECT meq.email_id, meq.phone_id | ||
| FROM civicrm_mailing_event_queue meq | ||
| JOIN civicrm_mailing_job mj ON meq.job_id = mj.id AND mj.mailing_id = %1 AND mj.job_type = 'child' |
Contributor
There was a problem hiding this comment.
also do we still need to join to mailing job? can we go off the event_queue.mailing_id?
It has been reported that some recipients may be silently skipped during large CiviMail dispatches. The "why" is unclear, it may be due to deadlocks or concurrency issues. This adds a stopgap to ensure these irregularities are caught, fixed, and hopefully people will report them and help us track down the root cause. See https://lab.civicrm.org/dev/core/-/work_items/6678
colemanw
force-pushed
the
queueMissingRecipients
branch
from
August 7, 2026 14:12
e045539 to
c058d04
Compare
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.
Overview
It has been reported that some recipients may be silently skipped during large CiviMail dispatches. The "why" is unclear, it may be due to deadlocks or concurrency issues. This adds a stopgap to ensure these irregularities are caught, fixed, and hopefully people will report them and help us track down the root cause.
See https://lab.civicrm.org/dev/core/-/work_items/6678