Skip to content

feat(guild): Do Not Text system note on contact opt-out change (1.x) - #9849

Open
FredPeal wants to merge 4 commits into
1.xfrom
feat/do-not-text-system-note
Open

FredPeal wants to merge 4 commits into
1.xfrom
feat/do-not-text-system-note

Conversation

@FredPeal

@FredPeal FredPeal commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Hook ContactObserver::updated to emit a Do Not Text enabled / Do Not Text disabled system note in the lead's systemNotes channel whenever is_opt_out changes.
  • Uses the existing ai-control MessageType so the trace appears alongside Sally mode and follow-up changes in the timeline.
  • Targets the most recent non-deleted lead of the contact's people.

Captures all paths that mutate is_opt_out: GraphQL updateContact mutation, $contact->opOut(), People::optOutPhoneContacts() (compliance handoff), and connector pulls (Elead/VinSolution).

Test plan

  • New: tests/GraphQL/Guild/ContactOptOutSystemNoteTest.php (4 tests, 12 assertions) — covers enable, disable, no-op update, and targets-most-recent-lead-only
  • Existing opt-out tests in tests/GraphQL/Guild/PeopleTest.php still green (8 tests, 31 assertions)

Hooks ContactObserver::updated to emit a 'Do Not Text enabled/disabled'
system note on the most recent lead's systemNotes channel whenever
is_opt_out flips. Uses the existing ai-control MessageType convention
so the change shows up alongside Sally mode / follow-up trace.
@FredPeal
FredPeal requested a review from kaioken June 2, 2026 06:13

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant