Follow-up to #3607272. The notification audience resolves to Drupal user accounts through assignment plugins, and the event carries recipients as full User entities keyed by uid. That cannot represent a pure email actor (an external address with no local account), nor any account-less contact (phone-only, Slack-only, an external partner). Keying by uid would also collide for account-less recipients (all uid 0).
Proposed solution: a small Recipient value object, a notification target that may carry an account and/or explicit contact points.
- Fields: an optional account, a contacts map (channel to value, e.g. mail, sms, slack), an optional langcode and label, and a key() for dedup.
- Change
AssignmentInterface::recipients()to return Recipient objects instead of account objects. User-based plugins return account-backed recipients; new Email and Email-by-variable assignment plugins return contact-backed recipients (with empty candidates(), so notification-only). - Each channel resolves its own address, explicit contact first then derived from the account: the mail channel uses the mail contact or the account email; an SMS or chat channel uses its contact or a user field; it skips a recipient it cannot reach.
- Key recipients and dispositions by the recipient key (uid, or the contact) so accounts dedup by uid and contacts by address, fixing the uid-0 collision.
Scope is the notification path only: assignment recipients(), the inbox recipients(), NotificationAudience, the event recipients, the mail channel and the To/Cc/Bcc grouping. Tasks-as-inbox, candidates() and the audit log are untouched. Orchestra is pre-1.0, so the @api recipients() change is acceptable.
Issue fork orchestra-3607367
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
mably commentedComment #4
mably commented