Difference between revisions of "Sms send"

From Catglobe Wiki
Jump to: navigation, search
(Sms_send)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
[[Category:Email_and_SMS_Functions]]
+
{{HelpFiles}}  
{{HelpFiles}}
 
  
====Sms_send====
+
==== Sms_send ====
  
This function makes it possible to send SMS messages to users.
+
This function makes it possible to send SMS messages to users.  
  
'''Syntax'''
+
'''Syntax'''  
  
Sms_send(''userResourceIds, smsoutprovidername, message, [fromresourceid]'')
+
Sms_send(''userResourceIds, smsoutprovidername, message, [fromresourceid]'')  
  
'''Arguments'''
+
'''Arguments'''  
  
''userResourceId:'' array of ids of the users who are to receive the SMS
+
''userResourceId:'' array of resource 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.
+
''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.
+
''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.
+
''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'''
+
'''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:
+
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:  
  
{| class="tableintopic" style="border-collapse: collapse; border: 1px solid #010101" width="907" border="1" cellpadding="2"
+
{| width="907" cellpadding="2" border="1" class="tableintopic" style="border-collapse: collapse; border: 1px solid #010101"
 
|- align="left" valign="top"
 
|- align="left" valign="top"
| style="border: 1px solid #010101" width="48" bgcolor="#FACEAA" |
+
| width="48" bgcolor="#FACEAA" style="border: 1px solid #010101" |
Code
+
Code
| style="border: 1px solid #010101" width="288" bgcolor="#FACEAA" |
+
 
Constant name
+
| width="288" bgcolor="#FACEAA" style="border: 1px solid #010101" |
| style="border: 1px solid #010101" width="571" bgcolor="#FACEAA" |
+
Constant name
Description
+
 
 +
| width="571" bgcolor="#FACEAA" style="border: 1px solid #010101" |  
 +
Description  
 +
 
 
|- align="left" valign="top"
 
|- align="left" valign="top"
| style="border: 1px solid #010101" width="48" |
+
| width="48" style="border: 1px solid #010101" |  
0
+
0  
| style="border: 1px solid #010101" width="288" |
+
 
SMS_STATUS_SUCCESSFUL
+
| width="288" style="border: 1px solid #010101" |  
| style="border: 1px solid #010101" width="571" |
+
SMS_STATUS_SUCCESSFUL  
Sent successfully
+
 
 +
| width="571" style="border: 1px solid #010101" |  
 +
Sent successfully  
 +
 
 
|- align="left" valign="top"
 
|- align="left" valign="top"
| style="border: 1px solid #010101" width="48" |
+
| width="48" style="border: 1px solid #010101" |  
1
+
1  
| style="border: 1px solid #010101" width="288" |
+
 
SMS_STATUS_NO_VALID_PHONE_NUMBER
+
| width="288" style="border: 1px solid #010101" |  
| style="border: 1px solid #010101" width="571" |
+
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
+
 
 +
| width="571" style="border: 1px solid #010101" |  
 +
No valid phone number is found to receive the message or user does not have at least 1 phone number  
 +
 
 
|- align="left" valign="top"
 
|- align="left" valign="top"
| style="border: 1px solid #010101" width="48" |
+
| width="48" style="border: 1px solid #010101" |  
2
+
2  
| style="border: 1px solid #010101" width="288" |
+
 
SMS_STATUS_MESSAGE_TOO_LONG
+
| width="288" style="border: 1px solid #010101" |  
| style="border: 1px solid #010101" width="571" |
+
SMS_STATUS_MESSAGE_TOO_LONG  
The message length exceeds 160 characters
+
 
 +
| width="571" style="border: 1px solid #010101" |  
 +
The message length exceeds 160 characters  
 +
 
 
|- align="left" valign="top"
 
|- align="left" valign="top"
| style="border: 1px solid #010101" width="48" |
+
| width="48" style="border: 1px solid #010101" |  
3
+
3  
| style="border: 1px solid #010101" width="288" |
+
 
SMS_STATUS_NOT_USER_RESOURCE
+
| width="288" style="border: 1px solid #010101" |  
| style="border: 1px solid #010101" width="571" |
+
SMS_STATUS_NOT_USER_RESOURCE  
The type of given resource is not type of user
+
 
 +
| width="571" style="border: 1px solid #010101" |  
 +
The type of given resource is not type of user  
 +
 
 
|- align="left" valign="top"
 
|- align="left" valign="top"
| style="border: 1px solid #010101" width="48" |
+
| width="48" style="border: 1px solid #010101" |  
4
+
4  
| style="border: 1px solid #010101" width="288" |
+
 
SMS_STATUS_USER_DOES_NOT_EXIST
+
| width="288" style="border: 1px solid #010101" |  
| style="border: 1px solid #010101" width="571" |
+
SMS_STATUS_USER_DOES_NOT_EXIST  
The given user does not exist
+
 
 +
| width="571" style="border: 1px solid #010101" |  
 +
The given user does not exist  
 +
 
 
|- align="left" valign="top"
 
|- align="left" valign="top"
| style="border: 1px solid #010101" width="48" |
+
| width="48" style="border: 1px solid #010101" |  
5
+
5  
| style="border: 1px solid #010101" width="288" |
+
 
SMS_STATUS_USER_DELETED
+
| width="288" style="border: 1px solid #010101" |  
| style="border: 1px solid #010101" width="571" |
+
SMS_STATUS_USER_DELETED  
This user has been deleted
+
 
 +
| width="571" style="border: 1px solid #010101" |  
 +
This user has been deleted  
 +
 
 
|- align="left" valign="top"
 
|- align="left" valign="top"
| style="border: 1px solid #010101" width="48" |
+
| width="48" style="border: 1px solid #010101" |  
6
+
6  
| style="border: 1px solid #010101" width="288" |
+
 
SMS_STATUS_USER_DISABLED
+
| width="288" style="border: 1px solid #010101" |  
| style="border: 1px solid #010101" width="571" |
+
SMS_STATUS_USER_DISABLED  
This user has been disabled
+
 
 +
| width="571" style="border: 1px solid #010101" |  
 +
This user has been disabled  
 +
 
 
|- align="left" valign="top"
 
|- align="left" valign="top"
| style="border: 1px solid #010101" width="48" |
+
| width="48" style="border: 1px solid #010101" |  
7
+
7  
| style="border: 1px solid #010101" width="288" |
+
 
SMS_STATUS_MISSING_RESOURCE_ACCESS
+
| width="288" style="border: 1px solid #010101" |  
| style="border: 1px solid #010101" width="571" |
+
SMS_STATUS_MISSING_RESOURCE_ACCESS
Current user does not have at least observer access to given user
 
  
'''Examples'''
+
| width="571" style="border: 1px solid #010101" |
 +
Current user does not have at least observer access to given user <!-- imported from file: 8073.htm-->
  
array users = {1234567,1234568,1234569};
+
|}
  
string smsprovidername = "TeleCo";
+
'''Examples'''
  
string msg = "The project has been completed";
+
array users = {1234567,1234568,1234569};  
  
Sms_send(users,smsprovidername,msg);
+
string smsprovidername = "TeleCo";  
  
'''Availability'''
+
string msg = "The project has been completed";
  
Version 5.8.1
+
Sms_send(users,smsprovidername,msg);
__NOTOC__
+
 
<!-- imported from file: 8073.htm-->
+
'''Availability'''
 +
 
 +
Version 5.8.1 __NOTOC__ <br>
 +
 
 +
[[Category:Email_and_SMS_Functions]]

Latest revision as of 05:05, 17 April 2012


Sms_send

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

Syntax

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

Arguments

userResourceId: array of resource 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