Files
discourse/plugins/automation/spec
Sam f9fce4712b FEATURE: support target_user_ids for private messages (#37708)
Add `target_user_ids` as an alternative to `target_usernames` when
creating private messages via PostCreator and TopicCreator. The two
options are mutually exclusive and raise ArgumentError if both are
provided.

This avoids username-based lookups where the caller already has user
IDs, and prevents stale references when users rename after a pending
PM is created.

Key changes:
- PostCreator/TopicCreator: accept `target_user_ids`, validate
  mutual exclusivity with `target_usernames`, extract shared
  `add_users_from_scope` in TopicCreator
- Automation PendingPm: migrate from `sender`/`target_usernames`
  string columns to `sender_id`/`target_user_ids` integer columns
  with a backfill migration
- Scriptable::Utils.send_pm: resolve sender upfront, support
  integer sender param, store IDs in pending PMs
2026-02-12 09:21:40 +11:00
..