CiviTestSMSProvider
extends CRM_SMS_Provider
in package
Test SMS provider to allow for testing
Table of Contents
Constants
- MAX_SMS_CHAR = 460
Properties
- $_id : mixed
- $provider : mixed
- $sentMessage : mixed
- $_singleton : object
- We only need one instance of this object. So we use the singleton pattern and cache the instance in this variable
Methods
- __construct() : mixed
- createActivity() : self|null|object
- formatPhone() : mixed|string
- getSentMessage() : string
- Get the message that was sent.
- processInbound() : self|null|object
- retrieve() : mixed
- send() : mixed
- Send an SMS Message via the API Server.
- singleton() : object
- Singleton function used to manage this object.
- stripPhone() : mixed|string
- urlEncode() : string
- formatPhoneNumber() : string
- Format phone number with % - this may no longer make sense as we now compare with phone_numeric.
Constants
MAX_SMS_CHAR
public
mixed
MAX_SMS_CHAR
= 460
Properties
$_id
protected
mixed
$_id
= 0
$provider
protected
mixed
$provider
$sentMessage
protected
mixed
$sentMessage
$_singleton
We only need one instance of this object. So we use the singleton pattern and cache the instance in this variable
private
static object
$_singleton
= []
Methods
__construct()
public
__construct(mixed $provider[, mixed $skipAuth = TRUE ]) : mixed
Parameters
- $provider : mixed
- $skipAuth : mixed = TRUE
createActivity()
public
createActivity(int $apiMsgID, mixed $message[, array<string|int, mixed> $headers = [] ][, int $jobID = NULL ][, int $userID = NULL ]) : self|null|object
Parameters
- $apiMsgID : int
- $message : mixed
- $headers : array<string|int, mixed> = []
- $jobID : int = NULL
- $userID : int = NULL
Tags
Return values
self|null|objectformatPhone()
public
formatPhone(mixed $phone, mixed &$kind[, string $format = "dash" ]) : mixed|string
since 5.73 will be removed around 5.95
Parameters
- $phone : mixed
- $kind : mixed
- $format : string = "dash"
Return values
mixed|stringgetSentMessage()
Get the message that was sent.
public
getSentMessage() : string
Return values
stringprocessInbound()
public
processInbound(mixed $from, mixed $body[, null $to = NULL ][, int $trackID = NULL ]) : self|null|object
Parameters
- $from : mixed
- $body : mixed
- $to : null = NULL
- $trackID : int = NULL
Tags
Return values
self|null|objectretrieve()
public
retrieve(string $name, mixed $type[, bool $abort = TRUE ][, null $default = NULL ][, string $location = 'REQUEST' ]) : mixed
Parameters
- $name : string
- $type : mixed
- $abort : bool = TRUE
- $default : null = NULL
- $location : string = 'REQUEST'
send()
Send an SMS Message via the API Server.
public
send(mixed $recipients, mixed $header, mixed $message[, mixed $dncID = NULL ]) : mixed
Parameters
- $recipients : mixed
- $header : mixed
- $message : mixed
- $dncID : mixed = NULL
singleton()
Singleton function used to manage this object.
public
static & singleton([mixed $providerParams = [] ][, mixed $force = FALSE ]) : object
Parameters
- $providerParams : mixed = []
- $force : mixed = FALSE
Return values
objectstripPhone()
public
stripPhone(mixed $phone) : mixed|string
Parameters
- $phone : mixed
Return values
mixed|stringurlEncode()
public
urlEncode(mixed $values) : string
Parameters
- $values : mixed
Return values
stringformatPhoneNumber()
Format phone number with % - this may no longer make sense as we now compare with phone_numeric.
private
formatPhoneNumber(string $phone) : string
Parameters
- $phone : string