|
This macro sends SMS messages using APIs available in the tool.
Numbers must include the country code.
Parameters
| Parameter |
Description |
| $arr_settings |
The macro has only one parameter, which must receive an array containing two arrays: one for configurations and another for the message. |
| Array Index |
Description |
| from |
Origin number of the message |
| to |
SMS recipient |
| message: |
The text message content |
| gateway: |
API to be used (clickatell, plivo, or twilio) |
| auth_token: |
API authentication token |
Examples
Example 1 - Basic structure for sending using clickatell:
$arr_settings = array(
'message' =>
[ 'from' => '+55999999999', //origin number (Required)
'to' => '+55999999999', //destination number (Required) 'message' => 'Scriptcase SMS' //Message to be sent (Required) ],
'settings' =>
[
'gateway' => 'clickatell', //sending gateway (Required)
'auth_token' => '54Cik1-gQ4GqtuN70d4y4w==' //API token (Required)
] );
sc_send_sms($arr_settings);
Example 2 - Basic structure for sending using Plivo:
$arr_settings = array( 'message' => [ 'from' => '+55999999999', //origin number (Required) 'to' => '+5581984796338', //destination number (Required) 'message' => 'Scriptcase SMS' //Message to be sent (Required) ], 'settings' => [ 'gateway' => 'plivo', //sending gateway (Required) 'auth_id' => 'MAMDHIYZM0YJCZYTJLNJ', //Authentication token (Required) 'auth_token' => 'ZGExOTgzZjNiOTE4YjBiN2ExMzdlZGYxYzQ4Yjc1' //API token (Required) ] );
sc_send_sms($arr_settings);
Example 3 - Basic structure for sending using Twilio:
$arr_settings = array( 'message' => [ 'from' => '+55999999999', //origin number (Required) 'to' => '+55999999999', //destination number (Required) 'message' => 'Scriptcase SMS' //Message to be sent (Required) //'mediaURL' => 'http://royalsalutre.netmake.com.br/tools/nm/sc_helpv9/gerado/dev/pt_br/manual_mp/assets/images/scriptcase-logo.svg', //Allows sending an image ], 'settings' => [ 'gateway' => 'twilio', //sending gateway (Required) 'auth_id' => 'MAMDHIYZM0YJCZYTJLNJ', //Authentication token (Required) 'auth_token' => 'ZGExOTgzZjNiOTE4YjBiN2ExMzdlZGYxYzQ4Yjc1' //API token (Required) ] );
sc_send_sms($arr_settings);
|