Skip to navigation

Creating a link with a variable

You can include a subscriber variable in any link in your newsletter. When sending, Laposta fills in that variable for each subscriber, so that everyone receives their own URL.

Only do this if you have a specific purpose for it, such as logging your subscribers in to your website automatically or recognising them as soon as they click through from your newsletter. If you want to customise the text, the subject or the preview text for each subscriber, you can personalise your newsletter in the usual way.

Putting the variable in the URL

You need an extra field in your list containing the value for each subscriber. In addition, when filling in your template in step 4, you can place a link in your newsletter with the corresponding subscriber variable in the place where that value should go.

Suppose you want subscribers to go straight to their own customer area on your site. You have a separate code for each customer, so you create the code field in your list. For customer Peter Petersen, the field value is ac9hj8er12. The link to your website then looks like this:

http://mijnsite.nl/webshop/acties/?code={{code}}

When sending to Peter Petersen, Laposta turns this into:

http://mijnsite.nl/webshop/acties/?code=ac9hj8er12

You can use any field from your list in a URL in this way, for example your subscriber’s first name, last name or email address.

Only putting the value in the field

For every link, Laposta records whether it has been clicked and how many times, including links with a subscriber variable. If Peter Petersen clicks his link twice, you will see this reflected in the clicks for your campaign.

For this to work, the field in your list must only contain the value, so ac9hj8er12 and not http://mijnsite.nl/webshop/acties/?code=ac9hj8er12. If you enter the entire URL as the field value instead, the link will still work, but Laposta will not record any statistics for this specific link. You will also no longer be able to use that field value in other URLs.

Encoding values with special characters

Laposta copies the value of the variable exactly as it appears in your list and does not URL-encode it. This is because the variable can also be part of the path, where URL encoding is undesirable.

If you use the variable in the query string, as in the example above, and the value contains characters other than letters, numbers, -, ., _ and ~, make sure that you enter that value into your list already URL-encoded.