Page MenuHomePhabricator
Diviner Phabricator Tech Docs PhabricatorSMSImplementationTwilioAdapter

final class PhabricatorSMSImplementationTwilioAdapter
Phabricator Technical Documentation ()

This class is not documented.

Methods

public function setFrom($number)
Inherited

This method is not documented.
Parameters
$number
Return
wild

public function getFrom()
Inherited

This method is not documented.
Return
wild

public function setTo($number)
Inherited

This method is not documented.
Parameters
$number
Return
wild

public function getTo()
Inherited

This method is not documented.
Return
wild

public function setBody($body)
Inherited

This method is not documented.
Parameters
$body
Return
wild

public function getBody()
Inherited

This method is not documented.
Return
wild

public function getProviderShortName()

PhabricatorSMSImplementationAdapter

16 characters or less, to be used in database columns and exposed to administrators during configuration directly.

PhabricatorSMSImplementationTwilioAdapter
This method is not documented.
Return
wild

public function send()

PhabricatorSMSImplementationAdapter

Send the message. Generally, this means connecting to some service and handing data to it. SMS APIs are generally asynchronous, so truly determining success or failure is probably impossible synchronously.

That said, if the adapter determines that the SMS will never be deliverable, or there is some other known failure, it should throw an exception.

PhabricatorSMSImplementationTwilioAdapter
This method is not documented.
Return
null

public function getSMSDataFromResult($result)

PhabricatorSMSImplementationAdapter

Most (all?) SMS APIs are asynchronous, but some do send back some initial information. Use this hook to determine what the updated sentStatus should be and what the provider is using for an SMS ID, as well as throw exceptions if there are any failures.

PhabricatorSMSImplementationTwilioAdapter
This method is not documented.
Parameters
$result
Return
arrayTuple of ($sms_id and $sent_status)

public function pollSMSSentStatus($sms)

PhabricatorSMSImplementationAdapter

Due to the asynchronous nature of sending SMS messages, it can be necessary to poll the provider regarding the sent status of a given sms.

For now, this *MUST* be implemented and *MUST* work.

PhabricatorSMSImplementationTwilioAdapter
This method is not documented.
Parameters
PhabricatorSMS$sms
Return
wild

public static function sendSMS($to_numbers, $body)
Inherited

PhabricatorSMSImplementationAdapter

Convenience function to handle sending an SMS.

Parameters
array$to_numbers
$body
Return
wild

private function buildClient()

This method is not documented.
Return
wild

private function getSMSStatus($twilio_status)

Parameters
$twilio_status
Return
wild

private function formatNumberForSMS($number)

We expect numbers to be plainly entered - i.e. the preg_replace here should do nothing - but try hard to format anyway.

Twilio uses E164 format, e.g. +15551234567

Parameters
$number
Return
wild