TwilioSMS Data Connector

TwilioSMS() → {object}

The Twilio TwilioSMS Data Connector extends the functionality of the Twilio Data Connector. It provides functionality for sending TwilioSMS messages.

Returns:
object

The Twilio SMS Data Connector.

Functions

getSms(messageId) → (nullable) {object}

Gets details of an SMS ("text") message that was sent via Twilio. This includes the status, the date and time the message was created and the date and time the message was sent.

Parameters:
Name Type Description
messageId string

The ID of the message to retrieve. This is included as the sid property of the response object of sendSms.

See:
Returns:
object

Details of the message including sending status. Returns null if one or more parameters are omitted or invalid.

Example:
var response = connectors.verjio.twilio.getSms(tables.messages.messageId.value);
	if (response.status === connectors.verjio.twilio.sentStatus.SENT) {
		event.owner.addInfoMessage(`The message was sent ${response.date_sent}`);
	}

sendSms(to, contentId, contentDataopt, fromopt, paramsopt) → (nullable) {object}

Send an SMS ("text") message to a specified phone number.

If no sender is specified using the from parameter, a sender is picked automatically from the phone numbers available to the Twilio account.

Parameters:
Name Type Attributes Default Description
to string    

Recipient phone number. This must be in E.164 format.

contentId string    

SID of the preconfigured message content. This should be pre-defined using Twilio Content.

contentData object <optional>  

Optional object containing the values of any placeholder variables in the content.

from string | object <optional> picked automatically

Message sender. This can be the SID of a Messaging Service, a phone number as a string or an object, as returned by getPhoneNumber. The sender must be available to the Twilio account.

params object <optional>  

Additional parameters to send.

See:
Returns:
object

Details of the message including sending status. Returns null if one or more parameters are omitted or invalid.

Examples:
// Send an SMS message
// The sender phone number is picked automatically
var response = connectors.verjio.twilio.sendSms(
	connectors.verjio.twilio.helpers.formatPhoneNumber(tables.customer.mobile.value),
	'HX0cc2dc920fdcfcd834fa77dab742dbc6',
	{ 1: tables.customer.name.value }
);
// Send an SMS message with a specified sender
// No content data is required
var response = connectors.verjio.twilio.sendSms(
	'+447551008330',
	'HXb53a9c742d3e1291db96f22c0a91c9c7',
	null
	'+447393518990'
);