Skip to content

v1.1.2 — Eligibility-to-apply notification + attribution fix

Latest

Choose a tag to compare

@makowskid makowskid released this 01 May 09:39

Highlights

  • New PartnerEligibleToApply notification — emails the user the moment they cross affiliate.min_referred_users and don't already have an open application. Links to /dashboard/affiliate so they can apply, accept terms, and provide payout details.
  • affiliate:notify-eligible backfill 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 fixReferralAttributor::captureFromRequest and ::attributeNewUser now attribute referrals when the partner is STATUS_PENDING or STATUS_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 --force

Tests

PartnerEligibilityNotificationTest (4 cases) and NotifyEligiblePartnersCommandTest (2 cases). Full pest suite: 37 passed.