Documentation

CRM_Contact_Form_Task_SMSTrait

This trait provides the common functionality for tasks that send sms.

Table of Contents

Properties

$phones  : array<string|int, mixed>
The phones to be messaged.

Methods

formRuleSms()  : bool|array<string|int, mixed>
Form rule.
listTokens()  : array<string|int, mixed>
List available tokens for this form.
postProcess()  : void
Process the form after the input has been submitted and validated.
setDefaultValues()  : array<string|int, mixed>
Set the default form values.
bounceOnNoActiveProviders()  : void
filterContactIDs()  : void
getSmsProviderParams()  : array<string|int, mixed>
Get SMS provider parameters.
getValueForContact()  : mixed|null
Get the specified value for the contact.
isInvalidRecipient()  : bool
sendSMS()  : array<string|int, mixed>
Send SMS.

Properties

$phones

The phones to be messaged.

private array<string|int, mixed> $phones

Methods

formRuleSms()

Form rule.

public static formRuleSms(array<string|int, mixed> $fields) : bool|array<string|int, mixed>
Parameters
$fields : array<string|int, mixed>

The input form values.

Return values
bool|array<string|int, mixed>

true if no errors, else array of errors

listTokens()

List available tokens for this form.

public listTokens() : array<string|int, mixed>
Return values
array<string|int, mixed>

postProcess()

Process the form after the input has been submitted and validated.

public postProcess() : void
Tags
throws
CRM_Core_Exception

setDefaultValues()

Set the default form values.

public setDefaultValues() : array<string|int, mixed>
Return values
array<string|int, mixed>

the default array reference

bounceOnNoActiveProviders()

protected bounceOnNoActiveProviders() : void

filterContactIDs()

protected filterContactIDs() : void

getSmsProviderParams()

Get SMS provider parameters.

protected getSmsProviderParams() : array<string|int, mixed>
Return values
array<string|int, mixed>

getValueForContact()

Get the specified value for the contact.

protected getValueForContact(int $contactID, string $value) : mixed|null

Note do not rename to getContactValue() - that function is used on many forms and does not take $id as a parameter.

Parameters
$contactID : int
$value : string
Tags
throws
CRM_Core_Exception
Return values
mixed|null

isInvalidRecipient()

protected isInvalidRecipient(mixed $contactID) : bool
Parameters
$contactID : mixed
Return values
bool

sendSMS()

Send SMS.

protected sendSMS(array<string|int, mixed> $phones) : array<string|int, mixed>
Parameters
$phones : array<string|int, mixed>
Tags
@return

array(array $errors, int $numberSent)

throws
CRM_Core_Exception
Return values
array<string|int, mixed>

        
On this page

Search results