SmsService
in package
Provides SMS services.
Table of Contents
- SENDER_NAME = 'LAM Pro'
- Sender name for SMS display.
- findProviders() : array<string|int, SmsProvider>
- Returns a list of SmsProvider objects.
- sendSms() : void
- Sends out an SMS.
- addCountryPrefixIfMissing() : string
- Adds the default country prefix to the telephone number if needed.
- cleanNumber() : string
- Cleans any extra characters from the telephone number.
- includeFiles() : void
- Includes all plugin files.
Constants
SENDER_NAME
Sender name for SMS display.
public
mixed
SENDER_NAME
= 'LAM Pro'
Methods
findProviders()
Returns a list of SmsProvider objects.
public
findProviders() : array<string|int, SmsProvider>
Return values
array<string|int, SmsProvider> —providers (id => provider object)
sendSms()
Sends out an SMS.
public
sendSms(string $message, string $number[, string|null $providerId = null ][, string|null $apiKey = null ][, string|null $apiToken = null ][, string|null $accountId = null ][, string|null $region = null ][, string|null $from = null ]) : void
Parameters
- $message : string
-
message text
- $number : string
-
mobile phone number
- $providerId : string|null = null
-
provider ID
- $apiKey : string|null = null
-
API key
- $apiToken : string|null = null
-
API token
- $accountId : string|null = null
-
account ID
- $region : string|null = null
-
region
- $from : string|null = null
-
from
Tags
Return values
void —addCountryPrefixIfMissing()
Adds the default country prefix to the telephone number if needed.
private
addCountryPrefixIfMissing(string $number) : string
Parameters
- $number : string
-
number
Return values
string —prefixed value
cleanNumber()
Cleans any extra characters from the telephone number.
private
cleanNumber(string $number) : string
Parameters
- $number : string
-
number
Return values
string —cleaned value
includeFiles()
Includes all plugin files.
private
includeFiles() : void