Difference between revisions of "Sms send"

From Catglobe Wiki
Jump to: navigation, search
Line 1: Line 1:
 
[[Category:Email_and_SMS_Functions]]
 
[[Category:Email_and_SMS_Functions]]

+
{{HelpFiles}}
  
 
====Sms_send====
 
====Sms_send====

Revision as of 09:08, 12 December 2011


Sms_send

This function makes it possible to send SMS messages to users.

Syntax

Sms_send(userResourceIds, smsoutprovidername, message, [fromresourceid])

Arguments

userResourceId: array of ids of the users who are to receive the SMS

smsoutprovidername: the name of the provider which will be used to send the SMS. Look for the ones available in your lists of SMS providers and copy the exact name from there.

message: the text that you want to send to the users. Should be a string of max 160 characters or it may get truncated.

fromresourceid: (optional) used to determine the source resource, which is again used to determine which keywords to use in the mail template, and also determines which SENT box the message ends up in. Default is current user.

Return type

An array of status codes will be returned as result of the function. There will exist one status for each user to which an SMS was sent. The status codes are:

Code

Constant name

Description

0

SMS_STATUS_SUCCESSFUL

Sent successfully

1

SMS_STATUS_NO_VALID_PHONE_NUMBER

No valid phone number is found to receive the message or user does not have at least 1 phone number

2

SMS_STATUS_MESSAGE_TOO_LONG

The message length exceeds 160 characters

3

SMS_STATUS_NOT_USER_RESOURCE

The type of given resource is not type of user

4

SMS_STATUS_USER_DOES_NOT_EXIST

The given user does not exist

5

SMS_STATUS_USER_DELETED

This user has been deleted

6

SMS_STATUS_USER_DISABLED

This user has been disabled

7

SMS_STATUS_MISSING_RESOURCE_ACCESS

Current user does not have at least observer access to given user

Examples

array users = {1234567,1234568,1234569};

string smsprovidername = "TeleCo";

string msg = "The project has been completed";

Sms_send(users,smsprovidername,msg);

Availability

Version 5.8.1