> ## Documentation Index
> Fetch the complete documentation index at: https://docs.younegotiate.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Groups

> ABC Collections wants to send a reminder to consumers with payments due next week. They create a group called "Payments Due Next Week".

## Real-World Example

ABC Collections wants to send a reminder to consumers with payments due next week. They create a group called "Payments Due Next Week". The group should include only matching consumers from ABC Collections.

When ABC Collections schedules a campaign, they can choose that group instead of manually selecting each consumer.

## Visual Flow

```mermaid placement="top-right" actions={true} theme={"system"}
flowchart TD
    A["Creditor defines group rules"] --> B["Matching consumers are selected"]
    B --> C["Group is saved"]
    C --> D["Creditor schedules campaign"]
    D --> E["Campaign uses the saved group"]
    classDef default fill:#F8FAFC,stroke:#64748B,stroke-width:1.5px,color:#0F172A;
    classDef actor fill:#E0F2FE,stroke:#0284C7,stroke-width:2px,color:#0C4A6E;
    classDef system fill:#F8FAFC,stroke:#64748B,stroke-width:1.5px,color:#0F172A;
    classDef decision fill:#FEF3C7,stroke:#D97706,stroke-width:2px,color:#78350F;
    classDef risk fill:#FEE2E2,stroke:#DC2626,stroke-width:2px,color:#7F1D1D;
    classDef outcome fill:#DCFCE7,stroke:#16A34A,stroke-width:2px,color:#14532D;
    class A actor;
    class B,D system;
    class C,E outcome;
    linkStyle default stroke:#94A3B8,stroke-width:2px;
```

## How It Should Work

* It should allow the creditor to create and manage groups for communication campaigns.
* It should include only consumers the creditor is allowed to access.
* Groups should be reusable when scheduling campaigns.

## How It Should Not Work

* It should not include consumers from another creditor.
* It should not send communications to consumers who should be excluded.
* It should not silently change a group without the creditor's action.

## Developer Notes

* Always check audience, creditor ownership, template selection, and opt-out/communication rules before sending.
* Background campaign work should record enough status for the tracker to explain sent, pending, and failed activity.

## Related App Areas

* `routes/creditor/index.php`
* `app/Livewire/Creditor/Communications`
* `app/Console/Commands/RunCampaignCommand.php`
* `app/Jobs/SendCampaignEmailSmsOrELetterJob.php`
