Trigger Templates
Trigger templates help you automatically generate trigger scripts without writing any code or they can be a way to quickly get started with customized triggers scripts.
Triggers are small scripts files or stored procedures that execute automatically when receiving a message. Trigger can run on failure or success as well. Find out how to create triggers here.
A trigger template can be used to either generate VBScript, Javascript or SQL Script triggers. You can modify the script after generating from a template. Find out how to write, customize and test triggers here.
The following trigger templates are available in the SMS Server:
- Empty trigger
- Apply delivery reports
- Forward trigger
- Auto reply
- Retry / Failover
- Database query
- Web/HTTP query
- SMPP server bind
- SMPP server acknowledge
- SMPP server forward delivery reports
- SMPP server assemble multipart SMS
Empty trigger
Supported languages: VBScript, JavaScript, SQL Script
This template creates the trigger definition and attaches an empty script file that has the proper structure. Expand this script in any way required.
Apply delivery reports
Supported languages: VBScript, Javascript
This template applies the delivery report status to it’s originating message. Create a new trigger from this template for every channel that should have delivery reports automatically applied.
Delivery reports in the SMS Server are just a type of SMS message. The delivery report contains the delivery status of the originating message. A delivery report and its originating message are linked by the message reference.
Multiple SMPP channels can be selected because in some cases multiple connections to the same provider will result in delivery reports appearing on a different SMPP channel from the originating SMS. This is not possible for GSM channels.
This trigger updates the message StatusID field to either ‘DELIVERED’ or ‘NOTDELIVERED’.
Input | Description |
SMS Channel(s) | Delivery reports on these SMS channel(s) are matched with originating messages on these channel(s). |
Forward trigger
Supported languages: VBScript, Javascript
Use this template to automatically forward messages to a different channel.
Use cases:
- Forward SMS to E-mail
- Forward E-mail to SMS
- Pickup file to SMS
- Pickup file to E-mail
- Auto reply to E-mail (forward IMAP or POP3 to SMTP)
- Route SMPP messages over SMPP channels
The generated trigger script runs on an incoming message on the originating channel. It creates a new outgoing message on the outgoing channel.
These options can be specified in the forward trigger. The message fields will be formatted with the below placeholders and set to the newly created message:
Input | Description |
From channel | The originating channel |
To channel | The destination channel |
Forward delivery reports (yes/no) | If SMS delivery reports should be forwarded as well |
ToAddress | Recipient phone nr. or e-mail address |
CC | CC (Carbon copy) e-mail addresses |
BCC | BCC (Blind carbon copy) e-mail addresses |
Subject | E-mail subject |
Body (plain) | SMS or E-mail body |
Body (HTML) | E-mail HTML body |
The message properties of the new, outgoing, message can either be pre-defined values or they can be parts of the originating message. These are formatted using the following placeholders:
Token | Original message type | Use |
%FROMADDRESS% | SMS/E-mail | Originator phonenr or e-mail address |
%TOADDRESS% | SMS/E-mail | Recipient phonenr or e-mail |
%CCADDRESS% | CC address line | |
%BCCADDRESS% | BCC address line | |
%SUBJECT% | Subject | |
%BODY% | SMS | Body |
%BODYPLAINTEXT% | Plain text body | |
%BODYHTML% | HTML body | |
%FROMUSERNAME% | Username part from e-mail (part before ‘@’ sign) | |
%PATH% | File | Full path |
%FILENAME% | File | Filename without directory |
%1STLINE% | File | 1st line |
%2NDLINE% | File | 2nd line |
%3RDLINE% | File | 3rd line |
%2NDLINETOEOF% | File | 2nd line to end of file |
%3NDLINETOEOF% | File | 3nd line to end of file |
%4NDLINETOEOF% | File | 4th line to end of file |
Auto reply
Supported languages: VBScript, Javascript
Use the auto reply trigger to generate an automatic reply to an incoming SMS.
For generating an automatic reply to an e-mail message use the forward trigger.
Input | Description |
Channel | The channel on which this trigger should work |
Body | The reply SMS body |
The body can either be completely pre-defined or formatted using placeholders from the original message. The following place holders are available:
Token | Use |
%FROMADDRESS% | Originator phonenr |
%TOADDRESS% | Recipient phonenr |
%BODY% | Body |
Retry / Failover
Supported languages: VBScript, Javascript
Use this trigger to automatically retry a message either on the same channel or on a new channel.
Input | Description |
Trigger channel | The channel to check |
Retry channel | The channel to retry on |
Max retries | The maximum number of times to retry a message |
Database query
Supported languages: VBScript, Javascript
Automatically replies with the ‘Enabled’ status of the channel named in the SMS or e-mail message.
This channel is intended to be used as a simple template for triggers that need to access a database to retrieve a value.
Input | Description |
Channel | The channel to check for received messages |
Web/HTTP query
Supported languages: VBScript, Javascript
Automatically replies with a random fortune from this link.
This channel is intended to be used as a simple template for triggers that need to access a web service to retrieve a value.
Input | Description |
Channel | The channel to check for received messages |
SMPP server bind
Supported languages: VBScript, Javascript
Use together with the SMPP Server channel. Find out how to setup a complete secure SMPP Server here.
This is the way to authenticate an incoming SMPP Server bind.
If all parameters are left empty the SMPP Server channel will allow anyone to connect. Otherwise it will use the specified data table.
This trigger can work on multiple SMPP Server channels so you can use the same user table for all of them.
Input | Description |
Channel(s) | The SMPP Server channel(s) to trigger on |
Connection string | Insert the connection string to your user table or use the connection string builder |
Lookup table | Use this table to lookup SMPP user credentials |
System ID field | This field in the lookup table contains the System ID (login) of your users |
Password field | This field in the lookup table contains the password. If the password is a hash value please specify this in the SMPP Server channel settings. |
SMPP server acknowledge
Supported languages: VBScript, Javascript
Use together with the SMPP Server channel. Find out how to setup a complete secure SMPP Server here.
This script will accept or reject an incoming SMS from an SMPP client.
If all fields are left empty it will accept every message. If you fill in the database details it will only acknowledge the messages when the client still has a positive credit balance.
This trigger can work on multiple SMPP Server channels so you can use the same user table for all of them.
Input | Description |
Channel(s) | The SMPP Server channel(s) to trigger on |
Connection string | Insert the connection string to your user table or use the connection string builder |
Lookup table | Use this table to lookup SMPP user credentials |
System ID field | This field in the lookup table contains the System ID (login) of your users |
Credits field | This field in the lookup table contains the number of credits. If the client has a positive number of credits the trigger will automatically subtract one credit. |
SMPP server forward delivery reports
Supported languages: VBScript, Javascript
Use together with the SMPP Server channel. Find out how to setup a complete secure SMPP Server here.
Use this trigger to automatically forward in incoming delivery report to the SMPP client that sent the originating message.
This makes sense when you use the forward trigger to forward SMS from your SMPP clients to other channels. The delivery report will arrive on the channel that sent the original message and this channel will pick it up and send it to the right SMPP client.
This trigger needs to be recreated for every delivery state. This means that you will normally need 3 of these triggers to deal with ‘DELIVERED’, ‘NOTDELIVERED’ and ‘NOREPORT’.
Input | Description |
Channel(s) | Channel(s) that your SMPP server forwards to |
On status | On of ‘DELIVERED’, ‘NOTDELIVERED’, ‘NOREPORT’ |
SMPP server assemble multipart SMS
Supported languages: VBScript, Javascript
Use together with the SMPP Server channel. Find out how to setup a complete secure SMPP Server here.
This trigger will automatically assemble incoming SMS message parts. The SMPP Server channel does not automatically assemble them so that you will be able to subtract credits for every part individually. Also, you will need to have the individual message parts to be able to accurately track and generate delivery reports.
However it makes sense to assemble the full message from its parts when:
- You need to automatically process the full message text
- You need to forward to an HTTP channel
Input | Description |
Channel(s) | SMPP Server channels |