Adding Custom Variables

To meet the specific needs of your business, you can create custom variables and insert them into pages, blocks and email templates. The list of whitelisted variables that appears when you click the Insert Variable button includes both predefined and custom variables. As shown in the following image, the list of available variables for a specific email template is determined by the data that is associated with the template. See the Variable Reference for a list of frequently-used email templates and their associated variables.

Only whitelisted predefined or custom variables can be used in email and newsletter templates.

Step 1: Create a custom variable

  1. On the Admin sidebar, go to System > Other Settings > Custom Variables.

  2. Click Add New Variable.

    Custom variables Custom Variables

  3. Enter an identifier for Variable Code, using all lowercase characters without spaces.

    If needed, you can use an underscore character or hyphen to represent a space. For example: my_custom_variable

  4. Enter a Variable Name, which is used for internal reference. For example: My Custom Variable

  5. To enter the value that is associated with the variable, do one of the following:

    • For Variable HTML Value, enter the variable value formatted with simple HTML tags. For example: <b>This formatted content appears in place of the variable.</b>
    • For Variable Plain Value, enter the variable value as plain text without formatting. For example: This unformatted content appears in place of the variable.

    If you need more room, drag the lower-right corner of the text box.

    New custom variable New Custom Variable

  6. When complete, click Save.

Step 2: Insert the custom variable

The following example shows how to use Page Builder to insert a custom variable into a page.

  1. Open the page or block where the variable is to appear.

  2. Expand the Content section.

  3. In the left panel, click Elements and do one of the following:

    • Click in an existing text area where you want to insert the variable.

    • Drag a new Text object to the stage.

  4. At the far right of the editor toolbar, click () to insert a variable.

    Page Builder stage PageBuilder Stage and Panel

  5. In the list, select the custom variable that you want to insert and click Insert Variable.

    New custom variable Select Custom Variable

    The variable identifier appears as a placeholder in the editor.

    Page Builder stage Variable Placeholder

  6. When complete, click Save.