Wizards Toolkit Documentation

SMS.php

This contains Wizards Toolkit functions for sending SMS via Twilio

All rights reserved.

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Tags
author
Programming Labs
license
All rights reserved
version
2.0

Table of Contents

wzSendSMS()  : null
This uses Twilio to send SMS and stores message in.

Functions

wzSendSMS()

This uses Twilio to send SMS and stores message in.

wzSendSMS( string  $fncToPhone , string  $fncMessage [, string  $fncSubject = 'SMS' ], string  $fncFromUserUID [, string  $fncToUserUID = 'NULL' ]) : null

This will strip out non-numeric characters in phone number. If stripped phone number passed is not 10 or 11 digits an SMS will not be sent and an email alert will be sent to $gloTechSupport . If Twilio returns "pair violates a blacklist rule" this will also email $gloTechSupport . This is usually because phone owner blocked SMS from this number. Any other type of error will be logged into wzErrorLog. After sending text, this stores SMS sent into wzSMSsent data table.

Parameters
$fncToPhone : string

phone number to send text to

$fncMessage : string

message sent via SMS

$fncSubject : string = 'SMS'

only used for saving in wzSMSsent.SMSSubject for analytics, defaults to 'SMS'

$fncFromUserUID : string

defaults to 0 for Server, can pass in wzUsers.UID

$fncToUserUID : string = 'NULL'

defaults to NULL; can send wzUsers.UID for tracking

Tags
global

string $gloTwilioPhone your Twilio From Phone number defined in wz/wzServerInfo

global

string $gloTwilioSID our Account SID from www.twilio.com/user/account ; defined in wz/wzServerInfo

global

string $gloTwilioToken our Auth Token from www.twilio.com/user/account ; defined in wz/wzServerInfo

Return values
null

Search results