rsthn/rose-ext-twilio

Twilio Adapter for Rose

Installs: 12

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 1

Forks: 0

Open Issues: 0

Type:rose-extension

1.0.1 2022-03-12 08:42 UTC

This package is auto-updated.

Last update: 2024-05-12 13:22:11 UTC


README

This extension adds expression functions to Rose to send SMS using Twilio.


Installation

composer require rsthn/rose-ext-twilio

Configuration Section: Twilio

The configuration section should have the default settings that the extension will use when using the twilio::send function. If you want to change these runtime, use twilio::config first.

Field Type Description Default
sid string SID of Twilio API Required
token string Access Token Required
from string Phone number used as "send from". Required

Expression Functions

twilio::send targetPhoneNumber:string message:string

Sends an SMS to the specified phone number.

Returns: { error:string, errorCode:string, sid:string, price:number }

Example:

(twilio::send "+11115558888" "Hello World")

twilio::config settings:object

Changes one or more configuration settings. The settings object should have one or more fields just as the configuration section.

Returns: boolean

Example:

(twilio::config (& "sid" "SID_VALUE"))