Everything Else

The following hooks are provided for Everything Else related events.

AffiliateActivation

Executes as an affiliate is being activated.

Parameters

VariableTypeNotes
user_idintClient ID
affidintAffiliate ID

Response

No response supported

Example Code

<?php
add_hook('AffiliateActivation', 1, function($vars)
{
});

AffiliateCommission

Executes as affiliate commission is being applied to an affiliate to clear.

Parameters

VariableTypeNotes
user_idintClient ID
invoice_idintInvoice ID

Response

No response supported

Example Code

<?php
add_hook('AffiliateCommission', 1, function($vars)
{
});

AffiliateWithdrawalRequest

Executes when an affiliate withdrawal request is submitted.

Parameters

VariableTypeNotes
user_idintClient ID
affidintThe unique id of the affiliate making the request

Response

No response supported

Example Code

<?php
add_hook('AffiliateWithdrawalRequest', 1, function($vars)
{
});

CalcAffiliateCommission

Executes as an affiliate is being activated.

Parameters

VariableTypeNotes
user_idintClient ID
reffersintReffers Count
signupsintSignups Count
conversionratefloatComission Conversion Rate
SignUpBonusfloatSignup Bonus Amount
pendingComissionfloatPending Comission Amount
pendingComissionWithSybmolstringPending Comission Amount Symbol
comissionAmountfloatComission Amount
comissionAmountWithSybmolstringComission Amount Symbol
TotalCommissionfloatTotal Comission Amount
AvailableToWithdrawfloatComission Amount Available to Withdraw
AvailableToWithdrawWithSybmolstringComission Amount Available to Withdraw Symbol
withdrawnfloatWithdrawn Amount
withdrawnWithSybmolstringWithdrawn Amount Symbol
last_withdraw_datestringLast Comission withdraw date
withdraw_inrequestfloatComission Amount Withdraw in request
withdraw_inrequestWithSybmolstringComission Amount Withdraw in request Symbol
last_withdraw_inrequest_datestringComission Amount Withdraw in request Date
site_namestringSite Name
site_urlstringSite URL
PayoutPerPaidstring
affiliate_keystringAffiliate Key
affiliate_bonus_amountfloatAffiliate Bonus Amount
affiliate_payoutsArrayAffiliate Payout History
affiliate_commissions_pendingArrayAffiliate Pending History

Response

No response supported

Example Code

<?php
add_hook('CalcAffiliateCommission', 1, function($vars)
{
});

EmailPreLog

Runs prior to email being logged.

Parameters

VariableTypeNotes
user_idintClient ID
datetimestring
subjectstring
from_emailstring
from_namestring
ccstring
tostring
bccstring
messagestring
error_msgstring

Response

Accepts a return of key/value pairs to override the parameters to be logged. Use the same names as the input parameters. Return abort=true to abort logging of the email.

Example Code

<?php
add_hook('EmailPreLog', 1, function($vars)
{
    return ["abort"=>true,"message"=>"Abort Error Message Here"];
});

EmailPreSend

Runs prior to any templated email being sent.

Parameters

VariableTypeNotes
FromArrayFrom Array have Name and Email Info
ReplyToArrayReplyToArray have Name and Email Info
AddressTostring
Ccstring
Bccstring
Subjectstring
Bodystring
Attachmentsstring

Response

Accepts a return of key/value pairs to override the parameters to be logged. Use the same names as the input parameters. Return abort=true to abort logging of the email.

Example Code

<?php
add_hook('EmailPreSend', 1, function($vars)
{
    return ["abort"=>true,"message"=>"Abort Error Message Here"];
});

EmailTplMergeFields

Executes when editing an email template.

Parameters

VariableTypeNotes
typestringThe type of email template being edited.
general, product, order, invoice, domain, client, notification, admin, affiliate, support, other

Response

Accepts a return of key/value pairs to override the parameters to be logged. Use the same names as the input parameters. Return abort=true to abort logging of the email.

Example Code

<?php
add_hook('EmailTplMergeFields', 1, function($vars)
{
    $merge_fields = [];
    $type = $vars["type"];
    if($type == "other")
    {
       $merge_fields['my_custom_var'] = "My Custom Var";
       $merge_fields['my_custom_var2'] = "My Custom Var2";
    }
    return $merge_fields;
});

FetchCurrencyExchangeRates

Executes when updating currency exchange rates. All supported automatic update currencies are retured

Parameters

VariableTypeNotes
codestringCurrency Code
ratefloatCurrency Rate
baseboolif True then Base Currency else other currency.

Response

An array of key -> value pairs to define or override additional exchange rates.

Example Code

<?php
add_hook('FetchCurrencyExchangeRates', 1, function($vars)
{
    //Code here to fetch the the current exchange rate relative to USD
    //Return exchange rate relative to 1 USD
    return ['PKR' => 201.9];
});

LogActivity

Executes after an activity log entry has been created.

Parameters

VariableTypeNotes
userstring
useridint
timestampstring
ipaddrstring
descriptionstring
error_msgstring

Response

No Response Supported.

Example Code

<?php
add_hook('LogActivity', 1, function($vars)
{
});