A workspace can require a second person to approve every broadcast before it
is queued. The campaign is frozen at the moment of the request. It cannot be
sent from the waiting state.

## Settings

`GET /api/practices/{id}/approval-settings` returns:

```json
{ "required": true, "approver_email": "freigabe@example.com", "ttl_hours": 72 }
```

`PUT` the same shape to change it. When `required` is true, `approver_email`
must be set. `ttl_hours` is between 1 and 720. `locale` is `de`, `en` or empty
for the workspace default. The approver must be a different mailbox than the
creator.

### Per-list overrides

A list can override the workspace policy:

- `GET /api/practices/{id}/approval-overrides`
- `GET|PUT|DELETE /api/practices/{id}/approval-overrides/{listID}`

An override replaces required, approver, TTL and locale for campaigns sent to
that list. Deleting it falls back to the workspace policy.

## Flow

1. The creator starts or schedules a campaign.
2. Werkmail sets the campaign to `pending_approval` and stores a SHA-256 of
   subject, text, HTML and From.
3. The approver receives a mail with the campaign name, subject, recipient
   count, expiry in Europe/Vienna time and a link to the confirmation page.
4. The page has two POST actions: approve and reject. A GET never decides.
5. Approve rechecks the content hash, then queues the campaign. Reject sets
   `rejected` and the campaign is never sent.
6. If the content changed after the request, approval is refused and a new
   request is required.
7. The creator gets a transactional decision mail with the result, the
   approver and the rejection reason. It goes only to the stored creator.
8. In the last quarter of the lifetime, and at most 24 hours before expiry,
   the approver gets a reminder with a fresh link. The old link stops working
   when the token is rotated. A 2-hour request is reminded after 1.5 hours,
   not immediately.

The token is random, single use, stored only as a hash, and expires after the
configured TTL. A second click or a second approver cannot send twice.

An expired request never sends. The campaign stays in `pending_approval`.
Start a new approval request, or create a new campaign, after the expiry.

Settings require `settings.edit`. The public approve and reject routes accept
only the token. A missing, expired or already used token returns 400.

## API

- `GET /api/practices/{id}/broadcasts/{campaignID}/approval` returns the
  pending request or `{"status":"none"}`.
- `GET /api/practices/{id}/broadcasts/{campaignID}/approvals` returns the full
  history.
- `POST /api/practices/{id}/broadcasts/{campaignID}/approval/resend` rotates
  the token and sends the link again. An expired request is replaced.
- `POST /api/public/approvals/{token}/approve` approves.
- `POST /api/public/approvals/{token}/reject` rejects, with optional
  `{"reason":"..."}`.
- `GET /approval/{token}` is the human confirmation page.

## Webhooks

- `campaign.approval_requested`
- `campaign.approved`
- `campaign.rejected`

Each payload carries `campaign_id`, `campaign_name`, `subject`, `approval_id`,
`approver_email`, `requested_by`, `recipient_count`, `status` and `reason`.

## Safety rules

- The creator and the approver must be different mailboxes. The API rejects
  the same address when the creator is known.
- No approver or an expired request means the campaign stays unsent.
- Rejection is terminal. The creator must create a new campaign or a new
  approval request.
- The approval mail is transactional and does not count against marketing
  frequency caps.
- The creator gets the decision by transactional mail and the workspace gets
  the webhook.
