SMS.php
This contains Wizard’s 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
Table of Contents
- wtkSendSMS() : null
- This uses Twilio to send SMS and stores message in.
Functions
wtkSendSMS()
This uses Twilio to send SMS and stores message in.
wtkSendSMS(
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 wtkErrorLog.
After sending text, this stores SMS sent into wtkSMSsent
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 wtkSMSsent.SMSSubject for analytics, defaults to 'SMS'
- $fncFromUserUID : string
-
defaults to 0 for Server, can pass in wtkUsers.UID
- $fncToUserUID : string = 'NULL'
-
defaults to NULL; can send wtkUsers.UID for tracking