trigger

Get information on, create, or delete a transactional trigger. A trigger is automatically executed in response to certain events at a given time. A trigger is a template that is built onto an existing template. Only 5 triggers per template are allowed.

Please also see Trigger Overview.

Base URL

https://api.sailthru.com/trigger

GET Mode

Optional Parameters

Parameter Description Example
template Name of the template welcome
trigger_id Trigger ID 4e2f17e46803fa2847000000
event Event Name user.register

Pass any of the above parameters to query your triggers by them, or pass no parameters and get all the triggers in the system

 

Return Value

Field Description Example
template Name of the template welcome
triggers List of trigger items

 

Each trigger item has the following structure:

Field Description Example
trigger_id Trigger ID 4e2f17e46803fa2847000000
time Trigger time something like 10 mins 2 days 75 minutes
event Event – can occur on click, open, send, purchase or cancel click
zephyr Zephyr Syntax {api_send("template_name")}

 

POST Mode

Create a trigger

Required Parameters

Parameter Description Example
template Name of the template welcome
time Trigger time, must be integer value 10
time_unit Trigger time unit – can be minutes, hours or days minutes
event Event – set to occur on click, open, send, purchase or cancel send
zephyr Zephyr syntax {api_send("template_name")}

OR

Parameter Description Example
event Name of the event user.register
time Trigger time, must be integer value 10
time_unit Trigger time unit – can be minutes, hours or days minutes
zephyr Zephyr syntax {api_send("template_name")}

Return Value

Same as GET mode

 

Custom Zephyr Scripts

The zephyrparameter is used for a custom Zephyr script.

A trigger’s possibilities are immensely increased when used with a Zephyr custom script. There are two special functions you can include with a trigger:

  • api_user – For updating user profiles
  • api_send – For sending transaction email

Making use of profile and message objects along with Zephyr can be quite powerful.

 

Please click here for example custom scripts.

 

DELETE Mode

Delete single trigger or all triggers that exist on a template

Parameter Description Example
template Name of the template welcome

Optional Parameters

Parameter Description Example
trigger_id Trigger ID 4e2f17e46803fa2847000000

If trigger_idparameter is not present, all triggers associated with the template will be deleted

Return Value

Same as of GET mode

 

Top