> ## 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.

# Scheduled Follow-Up Communications

> Jane misses a step after receiving a campaign message. The portal creates a scheduled follow-up.

## Real-World Example

Jane misses a step after receiving a campaign message. The portal creates a scheduled follow-up. Each morning, the scheduled communication command checks whether the follow-up is still valid, sends it if allowed, or removes it if the condition is already resolved.

## Visual Flow

```mermaid placement="top-right" actions={true} theme={"system"}
flowchart TD
    A["Campaign or workflow schedules follow-up"] --> B["Daily command runs at 06:00"]
    B --> C["Portal finds due scheduled communications"]
    C --> D{"Still valid and not opted out?"}
    D -->|Yes| E["Follow-up job is dispatched"]
    D -->|No| F["Follow-up is deleted or skipped"]
    E --> G["Next send time is updated when needed"]
    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,B,C,E,F,G system;
    class D decision;
    class F risk;
    class G outcome;
    linkStyle default stroke:#94A3B8,stroke-width:2px;
```

## How It Should Work

* It should send scheduled follow-ups only while the triggering condition still applies.
* It should stop follow-ups for deactivated, expired, resolved, or opted-out consumers.
* It should increment send counts and calculate the next send time consistently.

## How It Should Not Work

* It should not keep messaging consumers after the account condition is resolved.
* It should not ignore unsubscribe or communication permissions.
* It should not repeatedly send follow-ups beyond the configured expiration rules.

## Developer Notes

* ProcessScheduledCommunicationsCommand is scheduled daily at 06:00.
* ScheduledCommunicationService commonly creates follow-ups with a three-day cadence and expiration windows.

## Related App Areas

* `app/Console/Kernel.php`
* `app/Console/Commands/ProcessScheduledCommunicationsCommand.php`
* `app/Services/ScheduledCommunicationService.php`
* `app/Jobs/TriggerEmailAndSmsServiceJob.php`
