Splio allows you to dynamically generate a barcode or a QR code within your emails and landing pages.
Barcodes
Barcodes can be generated from:
- Database fields and custom fields, using variables
- Coupon codes, using the coupon variable
Supported barcodes formats:
Type | URL parameter | Example |
---|---|---|
Code 39 | code39 | ![]() |
Code 128 | code128 | ![]() |
EAN 13 | ean13 | ![]() |
INT 25 | int25 | ![]() |
Postnet | postnet | ![]() |
UPCA | upca | ![]() |
Generating the barcode
The barcode is generated when the script URL is being called.
In this URL, the type and value of the barcode have to be entered.
Here's an example of a barcode : « code 128 ».https://www.splio3.fr/barcode/barcode.php?code=3300013&type=code128
The URL contains 2 parameters to generate the barcode: code=3300013
and type=code128
Click the URL below to see an example in your browser:
http://www.splio3.fr/barcode/barcode.php?code=0075678164126&type=ean13
Generating EAN-13 barcode dynamically
If the barcode is a dynamic value, you shall edit the URL as shown below (the ean13 recalls each time a different value from the custom field $Barcode$:
https://www.splio3.fr/barcode/barcode.php?code=$Barcode$&type=ean13
Generating a barcode from a database field
If you have a code stored in a database field, use the field variable to dynamically input the code in the URL.https://www.splio3.fr/barcode/barcode.php?code=$my_code$&type=int25
The same applies if you have a code type in database:https://www.splio3.fr/barcode/barcode.php?code=$my_code$&type=$my_code_type$
Generating a barcode for a coupon
You can also generate a barcode using a coupon code, if your coupons' codes are in a supported format.https://www.splio3.fr/barcode/barcode.php?code=$CouponBirthday$&type=ean13
Adding the barcode to your email design
To dynamically add the barcode image in your email designs, simply add the barcode URL in an image tag.<img src="https://www.splio3.fr/barcode/barcode.php?code=$CouponBirthday$&type=ean13"/>
Dynamic Barcode Value
Since a barcode width is depending directly on its main value, we strongly discourage the use of fixed sizes for the barcode image. It could result in an unwanted transformation, and make it unreadable.
Background Color
Our barcode generator creates the codes on a white background, to ease its readability on scanners. Therefore, the background color is generated by default, and cannot be altered.
Alternative text
The alt
attribute can be filled in with the code's value, to globally help its overall usability.
QR code
QR code Url and parameters
Because the QR code can return anything from text to URL, there is only one parameter: data
. You can include anything you like.
URL Example
To include an URL to the QR Code, write data=url
https://www.splio4.com/barcode/qrcode.pl?data=http%3A%2F%2Fmywebsite.com
Generating a QR code from a database field
The same way you would for a barcode, you can insert dynamic content to the QR Code, by inserting a variable.
For instance, you could redirect a contact to your website, directly on their favorite brand's page, if the field is present in database:https://www.splio4.com/barcode/qrcode.pl?data=http%3A%2F%2Fmywebsite.com%2F$favorite_brand$
Generating the QR Code in an HTML Email
To have the image generated directly in your email, you can use the URL directly in the source of the image, as such:<img style="width:70px;" src="https://www.splio4.com/barcode/qrcode.pl?data=http%3A%2F%2Fmywebsite.com%2F$favorite_brand$">
QR Code image size
The example above shows a QR code of 70px wide. Consider the number of characters your QR Code must render, as the more there are characters, the more details (rows and columns) it will have, and the required scanning distance and size will vary.
Examples of QR code containing an URL:
Type | URL (unencoded) | QR Code | QR Code image URL |
---|---|---|---|
Website URL | https://mywebsite.com/$favorite_brand$/new_arrivals.php |
|
|
Google Maps URL | https://www.google.fr/maps/place/103+Boulevard+Haussmann,+75008+Paris/@48.8747405,2.315308,17z/data=!3m1!4b1!4m2!3m1!1s0x47e66fc98404ef03:0xd5c0c4fd77b8e7de |
|
Using accents, extended characters or URL
When including special characters or and URL, characters and spaces must be encoded, except for Splio's variables.
For instance, to have the QR code redirect to https://mywebsite.com
, the URL will have to be encoded as such: http%3A%2F%2Fmywebsite.com
With a variable, the url will look as such: http%3A%2F%2Fmywebsite.com%2F$favorite_brand$%2Fnew_arrivals.php
You can use an URL encoder such as this one to encode your URLs and special characters.