Once you have successfully set up a database connection either by importing your business-specific data to the internal, Emarsys-hosted database or by connecting your own, client-hosted database to Emarsys you can begin to use Relational Data to personalize your messages.
Before you start
There are two prerequisites which have to be fulfilled before you can use Relational Data for personalization:
Setting up reference fields
You can set up the reference fields for each of your database connections. To do this, go to: Add-ons -> Relational Data -> Tables & Views
For more information, see: Reference fields.
Setting up Relational Data variables
Relational Data variables are preconfigured sets of values for the reference fields of a particular table or view. They determine which data records are referenced by the placeholder that you add to your content.
In the Personalization pop-up, open the Relational tab and click New.
- Name your variable - Give the variable a name that will easily identify it.
- Select database connection - You should already have connected your database(s) under Add-ons -> Relational Data -> Connections. Choose the database with the table or view you want to use to personalize your message.
- Select table or view - After selecting the database, choose the table or view (which is a virtual table based on the result-set of an SQL statement).
- Set reference fields - The reference fields you set up under Add-ons -> Relational Data -> Tables & Views are shown here. You must add the Type and Value for each field that will determine which records are referenced by this personalization variable.
There are three types of input to choose from:
- Contact field - The value is a field from the contact database in Emarsys.
- External event - You can define the external event and a variable.
- Constant parameter - You can enter a fixed value yourself, for example a specific ZIP code or make of car.
After you have selected the type of input, add the Value for each one.
Since the reference fields are all linked by AND, you must define a value for every field before you can save your variable.
When you are finished, save your changes and your variable is now available for selection as the basis for a personalization placeholder.
Creating Relational Data personalization placeholders
When you have set up your variables, you can then use them to select the actual fields that you want to use for personalization.
- Select relational data variable - Choose from the variables you created earlier (or create a New one).
- Select field - All the fields in the view or table you selected for the variable are available for selection. It is the value in this field that will be added to the content for the recipients of your message.
- Make this field mandatory for sending - If one of your recipients has no value for this particular field, the message will not be delivered.
- Add fallback text - Fallback text is only available if you did not make the field mandatory. In this case, you can enter any text that can replace missing values.
- Format display text - Allows you to set the capitalization of your data if you wish, or you can leave it as is. For example, if you have stored ‘pet names’ with lowercase letters only, you can easily capitalize the first word (e.g. “simba” becomes “Simba” if you chose capitalization, or “SIMBA” with all caps).
- In the Placeholder field you will see the code of the personalization placeholder (written in Emarsys Scripting Language, ESL).
When everything is set, click Insert. A green personalization placeholder will appear in the text where you wanted to insert the personalization. You can move placeholders in the text freely by dragging and dropping them. It is also possible to modify the them - just click on them and then click the blue personalization icon to open the editor.