User Variable

Creating User Variables for site personalization

Add a User Variable such as “First Name” to your Email or Article etc.

If you want to add a User Variable –such as first name to your email (or article), the steps will depend on whether you are adding to the Subject field, or Plain text body which have the same instructions, or if you are adding it to the HTML body section which has instructions that vary slightly.

Please review both sets of instructions below:

In the email template editor Subject or Plain Text Field

  1. Click on the Insert User Variable Button
  2. Select from the User Variables Select Menu the variable you are wishing to add i.e. First Name
  3. If you wish to add an alternate phrase to populate the field in the case where there is no first name available, then Type that into the Alternate Phrase box.
  4. Click Insert Variable button. - Note: this inserts the code at the “end” of the field
  5. Back in the Email Editor Screen, you will need to CAREFULLY cut and paste the string of code that was inserted at the End of your field and paste it where you need it to be.
  6. Be sure to add in any punctuation you will need after you insert code, but be careful not to disturb the code itself. i.e. adding a comma after Dear First Name,


Notes:

*If you want to do more than one variable i.e. First Name and Last Name, you will need to create and insert them one at a time; following the process above, and adding a space in between each one.

*Do not copy the code form the Insert User Variable Code Screen and paste it directly into the editor, you must click the Insert Variable Button at the bottom of that screen, or the code will not render correctly and will not work.

*Keep in mind that the code is inserted at the end of the field you are working in, so you will need to cut and paste it to the correct location in your editor.

 

In the email template editor HTML Body

  1. Click you mouse where you wish to insert the User Variable
  2. Click on the Insert Content Object or HTML code tool ( Yellow ‘Stickie’ Note)
  3. Select User Variable from the Menu, which brings you to the Insert User Variable Code screen.
  4. Next, select from the User Variables Select Menu the variable you are wishing to add i.e. First Name
  5. If you wish to add an alternate phrase to populate the field in the case where there is no first name available, then Type that into the Alternate Phrase box.
  6. Click Insert Variable button.
  7. Be sure to add in any punctuation you will need after you insert code, but be careful not to disturb the code itself. i.e. adding a comma after Dear First Name,

Notes:

*If you want to do more than one variable i.e. First Name and Last Name, you will need to create and insert them one at a time; following the process above, and adding a space in between each one.

*Do not copy the code form the Insert User Variable Code Screen and paste it directly into the editor, you must click the Insert Variable Button at the bottom of that screen, or the code will not render correctly and will not work.


Technical Aspects of User Variables

User Variables can be of 2 types - Global and Local.

Global User Variables may be referenced in any Email List Rule and their values will be retrieved automatically. Global User Variables are any User Variable that is defined as linked to request.stUser scope variables.

Local User Variables must be explicitly assigned immediately prior to the template where they will be used. Local User Variables are any User Variable that is defined as linked to request.sv_ scope variables.

Here are the object properties that are available to you when in the Editor:

Name - a one word descriptor of the variable that users will refer to when referencing the variable. You may use upper and lower case, and the hyphen and underscore characters to improve readability.

Description - a brief description of the variable and its source in the system

Source -

  • If you wish to define a Global User Variable, the source of the variable must be in the request.stUser scope, e.g., request.stUser.email. Any variable that can be defined in the Execution Code of a List Rule object may be included here.
  • If you wish to define a Local User Variable, the source of the variable must be in the request.sv_ scope, e.g., request.sv_orderDate.