MessagingSmsProviderTwilio

Reference for the MessagingSmsProviderTwilio module: a Twilio SMS provider registered as a vendor of the MessagingSms type. It exposes a single static function that sends a text message through the Twilio REST API using configured account credentials.

This page is a pure reference. For how the framework fits together, see the Guide.

Classes

MessagingSmsProviderTwilio

The Twilio SMS provider. Its single function sends a message through the Twilio REST client, reading the account credentials from config. It is registered as the twilio vendor of the MessagingSms type and provides that type's send implementation.

Functions

Send

MessagingSmsProviderTwilio::Send(string $from, string $to, string $text): void

Send an SMS without saving it into the database, useful when sending error messages, for instance when the database is down. Throws when the send fails.

NameTypeDescription
$fromstringThe sending phone number.
$tostringThe recipient phone number.
$textstringThe message body.

Returns void