Opper variable system
Opper Mail offers a variable system that allows you to create new editable components for your newsletters. These variables can be used in any of your component.
Global variable
These variables are accessible in any component of your template.
Default global variables
These variables are natively implemented for any template.
Global variable | Description |
---|---|
${mirror_link} | The newsletter mirror link. |
${unsubscription_link} | The unsubscribe link. |
${date: DATE_FORMAT} | Returns today's date. The format is expressed according to the ISO 8601 standard. |
${tomorow: DATE_FORMAT} | Returns tomorows's date. The format is expressed according to the ISO 8601 standard. |
${users.email} | The email of the targeted user. |
${user.guid} | User guid. This ID is the one used for tracking navigation on your website. |
${email_ALGORITHM} | User email encoded with an ALGORITHM. ALGORITHM can take the value "md5", "sha1", "sha256" or "base64". |
${users.data_*} | Access any user additional data stored in the database (ex: user.data_firstname). |
Global custom variables
Go to the Configuration tab of your campaign to create global custom variable.
These variables could be used in every component. It's the best way, for instance, to have a global color to thematize your campaign. In that case, in the configuration pop-up, choose the type "Color".
Components variables
These native variables are accessible in one component of your template. When you put some of these variables in your components, a Content tab will appear.
The items
For each component, you can use several "items". For instance, if your component should display 2 articles, we recommend you to introduce 2 items : item1 and item2. Each item can contain a certain number of variables. Here is how to write a variable for a given item:
1 2 |
|
Each time you introduce a new item number the software will propose you to create such new items.
Once you validated the item creation, a Content tab will appear. The fields that will appear in the Content tab will depend on the variables you have used in your code for each item.
The items default variables
The default variables are described in the table below. They represent common feature of an article.
Native variable for items | Description |
---|---|
link | URL of the item |
title | Title of the item |
description | Description of the item |
image | URL of the image of the item |
category | Category of the item |
author | Item's author |
publication_date | Date of publication |
The items custom variables
In addition to native variables, you may want to make other elements editable in the content tab. These could be:
- Additional variables for your content, such as another heading level or the author's role.
- Additional variables that give your editors some control over the style of the newsletter, such as the colour of the ‘Read more’ button.
These variables are in the following format:
1 2 |
|
When you introduce a new custom variable, you will see it appear on the Content tab.
Now you have to configure this new variable by clicking on the little pencil. You will be able to give a type (color, text, image or boolean) and a human-friendly name.
The items "data" variable
These variables are in the following format:
1 2 |
|
You cannot create these variables directly. These variables are configured by the Opper Mail team to automatically retrieve some information from your content. This therefore depends on how your account has been configured by our team.
For example, if you want to automatically display the author's photo in one of your newsletters, we will provide you with variables such as:
1 |
|