Difference between revisions of "Sms sendMailTemplate"

From Catglobe Wiki
Jump to: navigation, search
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
[[Category:Email_and_SMS_Functions]]
+
{{HelpFiles}}

 
  
====Sms_sendMailTemplate====
+
==== Sms_sendMailTemplate ====
  
This function makes it possible to send SMS messages to users using a mailtemplate for the actual message.
+
This function makes it possible to send SMS messages to users using a mailtemplate for the actual message.  
  
'''Syntax'''
+
'''Syntax'''  
  
Sms_sendMailTemplate(''userResourceIds, smsoutprovidername, mailtemplateresourceid, [fromresourceid]'')
+
Sms_sendMailTemplate(''userResourceIds, smsoutprovidername, mailtemplateresourceid, [fromresourceid]'')  
  
'''Arguments'''
+
'''Arguments'''  
  
''userResourceId:'' array of ids of the users who are to receive the SMS
+
''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.
+
''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.  
  
''mailtemplateresourceid'': the resource id of the mail template that you want to send to the listed users.
+
''mailtemplateresourceid'': the resource id of the mail template that you want to send to the listed users.  
  
''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: 8074.htm-->
  
array users = {1234567,1234568,1234569};
+
|}
  
string smsprovidername = "TeleCo";
+
'''Examples'''
  
number mailtemplate = 678;
+
array users = {1234567,1234568,1234569};  
  
Sms_sendMailTemplate(users,smsprovidername,mailtemplate);
+
string smsprovidername = "TeleCo";  
  
'''Availability'''
+
number mailtemplate = 678;
  
Version 5.8.1
+
Sms_sendMailTemplate(users,smsprovidername,mailtemplate);
__NOTOC__
+
 
<!-- imported from file: 8074.htm-->
+
'''Availability'''
 +
 
 +
Version 5.8.1 __NOTOC__ <br>
 +
 
 +
[[Category:Email_and_SMS_Functions]]

Latest revision as of 09:22, 1 February 2012



Sms_sendMailTemplate

This function makes it possible to send SMS messages to users using a mailtemplate for the actual message.

Syntax

Sms_sendMailTemplate(userResourceIds, smsoutprovidername, mailtemplateresourceid, [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.

mailtemplateresourceid: the resource id of the mail template that you want to send to the listed users.

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";

number mailtemplate = 678;

Sms_sendMailTemplate(users,smsprovidername,mailtemplate);

Availability

Version 5.8.1