Sms sendMailTemplate

From Catglobe Wiki
Jump to: navigation, search



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