# Notifications and referral credits

Audoryx stores in-app notifications in Laravel's database notification channel. Users open `/app/notifications`, can mark one notification or all notifications as read, and see an unread badge in the Studio navigation.

## Administrative notifications

Open **Admin → Notifications** to send an announcement to one verified account email or to every registered user. Campaigns are queued, idempotent, and retain their actual delivery count and failure state. Run a production worker for both generation and notification queues:

```bash
php artisan queue:work --queue=audio-generations,notifications,default --tries=3
```

Generation completion and failure notifications are automatic. A failed generation returns charged credits through the idempotent credit ledger before the user is notified.

## Earn credits and referrals

Open **Admin → Referral program** to enable or pause referrals and set the inviter and new-user rewards. When enabled, every user receives a unique invite link from `/app/earn-credits`.

The referral code is applied during registration inside the same database transaction as account creation. Audoryx records one conversion per referred account and uses unique ledger idempotency keys for both rewards. Invalid codes roll back registration; pausing the program prevents new conversions without removing earlier links, conversions, or wallet history.

Review reward amounts, anti-abuse requirements, tax treatment, and promotion terms before enabling public referrals. For high-volume installations, add your own eligibility milestone (for example verified email or a first settled purchase) before issuing promotional credits.
