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
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 $jobID = null ][, mixed $userID = null ]) : mixed
Parameters
- $recipients : mixed
- $header : mixed
- $message : mixed
- $jobID : mixed = null
- $userID : 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