Template editor markdown

At the moment, SailPlay template editon has options for working with variables and conditions.

Variables

One of the core features of SailPlay Sender is the ability to assign variables to customers. Variable - is a string, that will be substituted with a stored value during the sending of and Email/SMS. For example, the variable $[first_name] would be substituted with the recipient's name during the send process.

During the use of any variable, a value may be specified which will be used in case the variable is missing or was not specified for a customer. Also the mechanism of substitution may be implemented using the conditional structures.

Variables can be used in Email and SMS marketing campaigns, as well as Email and SMS triggered messages. Variables can not only be used for the message body, but also be a part of e.g. a header or a URL address.

SailPlay system implements four types of variables:

  • System variables - contain the main information about a client and performed actions.

  • Custom variables - contain additional information about a client. Values are stored separately for every client.

  • Tag variables - contain additional information required to perform an action with the use of a specific tag. Values for these values are stored separately for every tag.

  • Global variables- values of global variables are tied to a partner's account.

To create or edit a variable, /api/v2/users/custom-vars/add/ is used for custom variables, and /api/v2/tags/vars/set/ for tag and global variables. Also, custom variables can be created using the SP.api.customVariables.add method of the JS SDK.

System variables

System variables contain general information about a client and performed actions.

List of availabe variables is displayed at the bottom of the message editor page

User data can be changed with the use of API /api/v2/users/update/ 

Variable syntax:

$[var|substitute]

Where:

   var - variable identifier,

   substitute - string that will be placed instead of a variable value in case the variable is missing or was not assigned

Usage example:

$[first_name|Client]

Custom variables

Custom variables can be used for a flexible personal client data storage. Custom variables are related only to a client and are accessible on demand.

Value can be assigned to a custom variable with the /api/v2/users/custom-vars/add/ API method, or with SP.api.customVariables.add JS SDK method. 

Variable syntax:

$[custom_vars[“var”]|substitute]

Where:

   var - variable identifier,

   substitute - string that will be placed instead of a variable value in case the variable is missing or was not assigned

Usage example:

$[custom_vars[“Last viewed product”]]

Tag variables

For the general campaign/trigger setup a tag(event) related variables can be used.

Value can be assigned to a tag variable using the /api/v2/tags/vars/set/ method

Variable syntax:

$[tag_vars[“tag”][“var”]|substitute]

Where:

   tag - identifier of a tag to which the variable will be assigned,

   var - variable identifier,

   substitute - string that will be placed instead of a variable value in case the variable is missing or was not assigned

Usage example:

$[tag_vars['Registration letter'][“Registration URL”]|#]

Global variables

Global variables do not depend on the performed action or the client. The can be only a single instance of a global variable with a specific name.

Values can be assigned to global variables with the /api/v2/tags/vars/set/ API method.

Variable syntax:

$[global_vars[“var”]|substitute]

Where:

   var - variable identifier,

   substitute - string that will be placed instead of a variable value in case the variable is missing or was not assigned

Usage example:

$[global_vars[“Today”]|Today]