WhatsAppNotificationsEvents
in package
Uses
NotificationParamParseTrait
FinalYes
Tags
Table of Contents
Methods
- __construct() : mixed
- formatInvoiceValue() : string
- getClientEmailByClientId() : string
- getClientFirstNameByClientId() : string
- getClientFirstTwoNamesByClientId() : string
- getClientFullNameByClientId() : string
- getClientIdByInvoiceId() : int
- getClientIdByOrderId() : int
- getClientIdByTicketId() : int|null
- getClientWhatsAppNumber() : string|null
- getCurrencySeparatorsFromFormatId() : array<string|int, mixed>
- WHMCS format id are related to the formats as follow:
- getHostDomainByHostId() : string
- getInvoiceBalance() : float|null
- Uses localAPI GetInvoice to get the invoice balance.
- getInvoiceCurrency() : stdClass
- Gets the info from the tblcurrencies database table.
- getInvoiceDueDateByInvoiceId() : string
- getInvoiceItems() : array<string|int, mixed>
- getInvoiceItemsByInvoiceId() : string
- getInvoiceItemsDescriptionsByInvoiceId() : array<string|int, mixed>
- getInvoicePdfUrlByInvocieId() : string|null
- getInvoiceSubtotal() : null|string|float
- getInvoiceTotal() : null|string|float
- getItemsRelatedToInvoice() : string
- Tries to get the items of the invoice first using getOrderItemsDescripByOrderId.
- getOrderIdByInvoiceId() : int|null
- getOrderItemsDescripByOrderId() : string
- Line items "type" and "domain".
- getServiceProductNameByProductId() : string
- getTicket() : string
- getTicketEmail() : string
- getTicketMask() : string
- getTicketNameColumn() : string
- getTicketSubject() : string
- getTicketWhatsAppCfValue() : int|null
- sendMsgToChatwootAsPrivateNote() : void
- sendMsgToChatwootAsPrivateNoteForUnregisteredClient() : void
Methods
__construct()
public
__construct() : mixed
Tags
formatInvoiceValue()
public
static formatInvoiceValue(int $invoiceId, float $value) : string
Parameters
- $invoiceId : int
- $value : float
Return values
stringgetClientEmailByClientId()
public
static getClientEmailByClientId(int $clientId) : string
Parameters
- $clientId : int
Return values
stringgetClientFirstNameByClientId()
public
static getClientFirstNameByClientId(int $id) : string
Parameters
- $id : int
Return values
stringgetClientFirstTwoNamesByClientId()
public
static getClientFirstTwoNamesByClientId(int $id) : string
Parameters
- $id : int
Return values
stringgetClientFullNameByClientId()
public
static getClientFullNameByClientId(int $id) : string
Parameters
- $id : int
Return values
stringgetClientIdByInvoiceId()
public
getClientIdByInvoiceId(int $invoiceId) : int
Parameters
- $invoiceId : int
Return values
intgetClientIdByOrderId()
public
getClientIdByOrderId(int $orderId) : int
Parameters
- $orderId : int
Return values
intgetClientIdByTicketId()
public
getClientIdByTicketId(int $ticketId) : int|null
Parameters
- $ticketId : int
Return values
int|nullgetClientWhatsAppNumber()
public
static getClientWhatsAppNumber(int $clientId) : string|null
Parameters
- $clientId : int
Return values
string|nullgetCurrencySeparatorsFromFormatId()
WHMCS format id are related to the formats as follow:
public
static getCurrencySeparatorsFromFormatId(int $formatId) : array<string|int, mixed>
1 - 1234.56 2 - 1,234.56 3 - 1.234,56 4 - 1,234
Parameters
- $formatId : int
Return values
array<string|int, mixed> —an array as: [decimal => '', thousands => ''].
getHostDomainByHostId()
public
getHostDomainByHostId(int $hostId) : string
Parameters
- $hostId : int
Return values
stringgetInvoiceBalance()
Uses localAPI GetInvoice to get the invoice balance.
public
static getInvoiceBalance(int $invoiceId[, bool $formatFriendly = true ]) : float|null
Parameters
- $invoiceId : int
- $formatFriendly : bool = true
Tags
Return values
float|nullgetInvoiceCurrency()
Gets the info from the tblcurrencies database table.
public
static getInvoiceCurrency(int $invoiceId) : stdClass
Parameters
- $invoiceId : int
Return values
stdClassgetInvoiceDueDateByInvoiceId()
public
static getInvoiceDueDateByInvoiceId(int $invoiceId) : string
Parameters
- $invoiceId : int
Return values
stringgetInvoiceItems()
public
getInvoiceItems(int $invoiceId) : array<string|int, mixed>
Parameters
- $invoiceId : int
Tags
Return values
array<string|int, mixed> —An array of items like: ( [id] => [type] => [relid] => [description] => [amount] => [taxed] => [product_id] => ) Some items may not have a product_id since it must be a manually-added product or a taxe.
getInvoiceItemsByInvoiceId()
public
static getInvoiceItemsByInvoiceId(int $invoiceId) : string
Parameters
- $invoiceId : int
Return values
stringgetInvoiceItemsDescriptionsByInvoiceId()
public
static getInvoiceItemsDescriptionsByInvoiceId(int $invoiceId) : array<string|int, mixed>
Parameters
- $invoiceId : int
Tags
Return values
array<string|int, mixed> —[0 => Description 1, 1 => Description 2]
getInvoicePdfUrlByInvocieId()
public
static getInvoicePdfUrlByInvocieId(int $id[, bool $returnNullOtherwise = false ]) : string|null
Parameters
- $id : int
- $returnNullOtherwise : bool = false
Return values
string|nullgetInvoiceSubtotal()
public
static getInvoiceSubtotal(int $invoiceId[, bool $formatFriendly = true ]) : null|string|float
Parameters
- $invoiceId : int
- $formatFriendly : bool = true
Return values
null|string|floatgetInvoiceTotal()
public
static getInvoiceTotal(int $invoiceId[, bool $formatFriendly = true ]) : null|string|float
Parameters
- $invoiceId : int
- $formatFriendly : bool = true
Return values
null|string|floatgetItemsRelatedToInvoice()
Tries to get the items of the invoice first using getOrderItemsDescripByOrderId.
public
static getItemsRelatedToInvoice(int $invoiceId) : string
If an empty string is returned, the uses getInvoiceItemsByInvoiceId.
Parameters
- $invoiceId : int
Tags
Return values
stringgetOrderIdByInvoiceId()
public
static getOrderIdByInvoiceId(int $invoiceId) : int|null
Parameters
- $invoiceId : int
Return values
int|nullgetOrderItemsDescripByOrderId()
Line items "type" and "domain".
public
static getOrderItemsDescripByOrderId(int $orderId) : string
Parameters
- $orderId : int
Tags
Return values
stringgetServiceProductNameByProductId()
public
static getServiceProductNameByProductId(int $productId) : string
Parameters
- $productId : int
Return values
stringgetTicket()
public
getTicket(int $ticketId, string $column) : string
Parameters
- $ticketId : int
- $column : string
Return values
stringgetTicketEmail()
public
getTicketEmail(int $ticketId) : string
Parameters
- $ticketId : int
Return values
stringgetTicketMask()
public
getTicketMask(int $ticketId) : string
Parameters
- $ticketId : int
Return values
stringgetTicketNameColumn()
public
getTicketNameColumn(int $ticketId) : string
Parameters
- $ticketId : int
Return values
stringgetTicketSubject()
public
getTicketSubject(int $ticketId) : string
Parameters
- $ticketId : int
Return values
stringgetTicketWhatsAppCfValue()
public
getTicketWhatsAppCfValue(int $ticketId) : int|null
Parameters
- $ticketId : int
Return values
int|nullsendMsgToChatwootAsPrivateNote()
public
sendMsgToChatwootAsPrivateNote(int $clientId, string $msg) : void
Parameters
- $clientId : int
- $msg : string
Tags
sendMsgToChatwootAsPrivateNoteForUnregisteredClient()
public
sendMsgToChatwootAsPrivateNoteForUnregisteredClient(int $phoneNumber, string $msg, string $clientName, string $clientEmail, int $inboxId) : void
Parameters
- $phoneNumber : int
- $msg : string
- $clientName : string
- $clientEmail : string
- $inboxId : int