Everything Else
The following hooks are provided for Everything Else related events.
AffiliateActivation
Executes as an affiliate is being activated.
Parameters
| Variable | Type | Notes |
|---|---|---|
| user_id | int | Client ID |
| affid | int | Affiliate 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
| Variable | Type | Notes |
|---|---|---|
| user_id | int | Client ID |
| invoice_id | int | Invoice ID |
Response
No response supported
Example Code
<?php
add_hook('AffiliateCommission', 1, function($vars)
{
});
AffiliateWithdrawalRequest
Executes when an affiliate withdrawal request is submitted.
Parameters
| Variable | Type | Notes |
|---|---|---|
| user_id | int | Client ID |
| affid | int | The 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
| Variable | Type | Notes |
|---|---|---|
| user_id | int | Client ID |
| reffers | int | Reffers Count |
| signups | int | Signups Count |
| conversionrate | float | Comission Conversion Rate |
| SignUpBonus | float | Signup Bonus Amount |
| pendingComission | float | Pending Comission Amount |
| pendingComissionWithSybmol | string | Pending Comission Amount Symbol |
| comissionAmount | float | Comission Amount |
| comissionAmountWithSybmol | string | Comission Amount Symbol |
| TotalCommission | float | Total Comission Amount |
| AvailableToWithdraw | float | Comission Amount Available to Withdraw |
| AvailableToWithdrawWithSybmol | string | Comission Amount Available to Withdraw Symbol |
| withdrawn | float | Withdrawn Amount |
| withdrawnWithSybmol | string | Withdrawn Amount Symbol |
| last_withdraw_date | string | Last Comission withdraw date |
| withdraw_inrequest | float | Comission Amount Withdraw in request |
| withdraw_inrequestWithSybmol | string | Comission Amount Withdraw in request Symbol |
| last_withdraw_inrequest_date | string | Comission Amount Withdraw in request Date |
| site_name | string | Site Name |
| site_url | string | Site URL |
| PayoutPerPaid | string | |
| affiliate_key | string | Affiliate Key |
| affiliate_bonus_amount | float | Affiliate Bonus Amount |
| affiliate_payouts | Array | Affiliate Payout History |
| affiliate_commissions_pending | Array | Affiliate Pending History |
Response
No response supported
Example Code
<?php
add_hook('CalcAffiliateCommission', 1, function($vars)
{
});
EmailPreLog
Runs prior to email being logged.
Parameters
| Variable | Type | Notes |
|---|---|---|
| user_id | int | Client ID |
| datetime | string | |
| subject | string | |
| from_email | string | |
| from_name | string | |
| cc | string | |
| to | string | |
| bcc | string | |
| message | string | |
| error_msg | string |
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
| Variable | Type | Notes |
|---|---|---|
| From | Array | From Array have Name and Email Info |
| ReplyTo | Array | ReplyToArray have Name and Email Info |
| AddressTo | string | |
| Cc | string | |
| Bcc | string | |
| Subject | string | |
| Body | string | |
| Attachments | string |
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
| Variable | Type | Notes |
|---|---|---|
| type | string | The 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
| Variable | Type | Notes |
|---|---|---|
| code | string | Currency Code |
| rate | float | Currency Rate |
| base | bool | if 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
| Variable | Type | Notes |
|---|---|---|
| user | string | |
| userid | int | |
| timestamp | string | |
| ipaddr | string | |
| description | string | |
| error_msg | string |
Response
No Response Supported.
Example Code
<?php
add_hook('LogActivity', 1, function($vars)
{
});