Skip to content

Referrals

Hook Reference

HookDescription
fluent_affiliate/referral_marked_unpaidFired after a referral's status is set to unpaid (ready for payout).
fluent_affiliate/referral/before_deleteFired immediately before a referral record is deleted.
fluent_affiliate/referral/deletedFired after a referral has been permanently deleted.
fluent_affiliate/referral_createdFired after a new referral record is inserted into the database.
fluent_affiliate/referral_marked_rejectedFired after a referral is marked as rejected.
fluent_affiliate/referral_commission_updatedFired after the commission amount on an existing referral is updated.

fluent_affiliate/referral_marked_unpaid

Fired after a referral's status is set to unpaid (ready for payout).

Parameters

ParameterTypeDescription
$referralReferralThe Referral model now in unpaid status.

Source: app/Http/Controllers/ReferralController.php

php
add_action('fluent_affiliate/referral_marked_unpaid', function($referral) {
    // Update an external ledger, send a notification, etc.
});

fluent_affiliate/referral/before_delete

Fired immediately before a referral record is deleted.

Parameters

ParameterTypeDescription
$referralReferralThe Referral model about to be deleted.

Source: app/Http/Controllers/ReferralController.php

php
add_action('fluent_affiliate/referral/before_delete', function($referral) {
    // Archive or sync before deletion.
});

fluent_affiliate/referral/deleted

Fired after a referral has been permanently deleted.

Parameters

ParameterTypeDescription
$idintID of the deleted referral.
$affiliateAffiliateThe affiliate who owned the referral.

Source: app/Http/Controllers/ReferralController.php

php
add_action('fluent_affiliate/referral/deleted', function($id, $affiliate) {
    // Post-deletion cleanup.
}, 10, 2);

fluent_affiliate/referral_created

Fired after a new referral record is inserted into the database.

Parameters

ParameterTypeDescription
$referralReferralThe new Referral model instance.

Source: app/Modules/Integrations/BaseConnector.php

php
add_action('fluent_affiliate/referral_created', function($referral) {
    // React to a new referral — e.g. send a notification.
});

fluent_affiliate/referral_marked_rejected

Fired after a referral is marked as rejected.

Parameters

ParameterTypeDescription
$referralReferralThe rejected Referral model.

Source: app/Modules/Integrations/BaseConnector.php

php
add_action('fluent_affiliate/referral_marked_rejected', function($referral) {
    // Notify the affiliate or log the rejection.
});

fluent_affiliate/referral_commission_updated

Fired after the commission amount on an existing referral is updated.

Parameters

ParameterTypeDescription
$referralReferralThe updated Referral model.

Source: app/Modules/Integrations/BaseConnector.php

php
add_action('fluent_affiliate/referral_commission_updated', function($referral) {
    // Sync the new amount to an external system.
});

Released under the GPL-2.0 License.