Highlights
- New
PartnerEligibleToApplynotification — emails the user the moment they crossaffiliate.min_referred_usersand don't already have an open application. Links to/dashboard/affiliateso they can apply, accept terms, and provide payout details. affiliate:notify-eligiblebackfill command — one-shot, mails every user who is currently eligible at upgrade time. Supports--dry-run(lists recipients without sending) and--force(skips the confirm prompt).- Attribution filter fix —
ReferralAttributor::captureFromRequestand::attributeNewUsernow attribute referrals when the partner isSTATUS_PENDINGorSTATUS_APPROVED, instead of approved-only. This unblocks the documented flow where a user shares their link via the share-only stub (STATUS_PENDING + applied_at=null) to gather referrals before applying. Rejected and suspended codes are still ignored.
Behaviour
The notification fires from both attributeNewUser (cookie / query attribution at signup) and manuallyAttach (admin tool). The trigger compares the partner's referred-count before and after the new AffiliateReferral::create() and only fires on the crossing — repeat referrals after the threshold do not re-email. Last-touch swaps notify the new partner-of-record when the swap puts them at or past the threshold.
Upgrade
composer update a2zwebltd/laravel-affiliate. No migrations.
After deploying, optionally run:
php artisan affiliate:notify-eligible --dry-run
php artisan affiliate:notify-eligible --forceTests
PartnerEligibilityNotificationTest (4 cases) and NotifyEligiblePartnersCommandTest (2 cases). Full pest suite: 37 passed.