In email or page objects, you can utilize global variables using the globals function. The advantage of this approach is that you only need to define variables once and can then reuse them in all other objects.

Set a global variable

{{$globals.<variabel name> = '<value>'}}

Get a global variable

{{$globals.<variabel name>}}

Examples

Set multiple globals

{{$globals.example1 = 'text'}}      // Text
{{$globals.example2 = 123}}        // Numbers
{{$globals.example3 = true}}       // Booleans


{{$globals.example3 = [1,2,3]}}    // Arrays

Retrieve a global variable value

{{$globals.<VARNAME>}}

{{* Foreach loop als de variabele een structuur bevat *}}
{{foreach $globals.<VARNAME> as $item}}
    {{$item}}
{{/foreach}}

It's also possible to define a global variable based on a property. See the example below where Google UTM variables are set based on properties:

globals obv properties

{{property name='UTM Medium' assign='UtmMedium'}}
{{property name='UTM Source' assign='UtmSource'}}
{{property name='UTM Campaign' assign='UtmCampaign'}}


{{$globals.utm_arguments = ['utm_campaign' => $UtmCampaign, 'utm_medium' => $UtmMedium, 'utm_source' => $UtmSource]}}