Let's Build a Direct Mailer with Merge Variable Data

Leveraging merge variable data in a direct mailing piece can add personalization to your campaign, whether it be for marketing, customer engagement or invoicing. At DiretMailer.io, we utilize variable data for a good bit of our clients, and today we will be walking through how to set up your first variable data mailer.

With merge variable data, you can be a one man wolfpack.

What is Variable Data?

Variable Data Mailing (or Variable Data Printing) is a process of merging data or information into your artwork layout from a database or external file source. This personalization for each collateral piece can increase the response rate & engagement in other marketing channels as well as offer customization of your message without increasing the time it takes to layout multiple variants of the artwork.

Levels of Variable Data

Variable data can be as simple or as advanced as your campaign requires. The most basic variable data is mail merge elements: data such as salutations, name & address information for each mail piece. This is the most common for simple mail campaigns. The second level of variable data is versioning: data such as images, text or call to action messages based on the segmentation of the campaign based on location, demographic or customer relationship. The last level is full variability: data such as image, text or layout data that is changeable for each recipient. Full variability is what we will use in this walkthrough.

Tools needed:

In order to get the most out of this walkthrough you will need some of the tools below:

  • Graphic or Page Layout Tool (We’ll be using Adobe inDesign)
  • HTML & CSS Code Editor (We’ll be using VSCode)
  • Data or Spreadsheet Tool (We’ll be using MS Excel)
  • Optional- A liveload web server to view HTML & CSS updates (We’ll be using Bridgetown)

The Static Mailer -> Dynamic Mailer Process

While the end result of this walkthrough will provide you with a HTML version of the mailer, we recommend starting with a static layout in a graphic or page layout tool as it is easier to convert from PDF to HTML if you already have the styling & composition configured.

Step 1- Create the artwork

Tool: inDesign


Noticed the items in pink on the template? Those are the variable data fields that will change based on each recipient dataset.
Use a graphic or page layout application to create your desired artwork. We have created a 4in x 6in (landscape orientation) postcard PDF or inDesign file for you to use as an example if you have not yet designed artwork on your own. As with most print artwork, make sure to incorporate a bleed on the document (we normally use .125in on all the parameters to match most common print guidelines). This will help your print collateral line up correctly during processing.

Step 2- Convert artwork to HTML

Tool: Bridgetown


The static HTML code that includes merge variable data.

In order to utilize merge variables with most automated print services, the artwork requires an inDesign (or PDF) to HTML conversion. While there are several different methods to achieve this as you can use any tools you are comfortable writing the HTML in. We also want to point out some important notes to keep in mind when converting your artwork to HTML code:

  • For most automated printing platforms, CSS styles need to be inline within the HTML page. This guarantees the code block will keep the styles you want to be displayed, as in most cases when you send this as an API request.
  • Fonts will need to be loaded from a public URL or stored in a S3 type of bucket. If you wish utilize any free font libraries available online, make sure you use them based on the documentation & licensing requirements.
  • Image assets in your artwork must be stored somewhere that is publicly available over the web. If you use S3 buckets, they may require some CORS or file permission setting adjustments unless you are able to upload them directly to your automated mailing platform directly.

Why use a static site generator?

The ability to view your changes to styles, graphics and HTML in real-time is a huge benefit when making multiple changes to your HTML Mailer. A static site generator like Bridgetown gives us a tool to leverage templates, frontmatter and a handful of other goodies that make the PDF -> HTML conversion easier.

Step 3- Prepare you Mailing List Data

Tool: Excel


Each merge variable data set is listed in its own column.

Most automated printing services enable you to upload your mailing list data via CSV. In the attached csv sample you will see columns that list first name, last name, address, city, state, zipcode. In addition you notice columns with the name duration, office_location, gender, agent_image & agent_email. These are the columns that contain the merge variables. They contain the dynamic fields your HTML will be combined with. Create your mailing list based on the variable types you have created in your artwork based on the campaign scope.

Step 4- Bundle the HTML Artwork & Mailing List

Tool: Automated Printing Provider of Choice (DirectMailer.io Platform Coming Soon)

You have your dynamic artwork. You have your mailing list with merge variables. Now it’s time to use the automated printing service provider of choice and send this campaign to print. Each process might be different, depending on the platform. Some may require you to recreate your HTML template in their WYSIWYG editor, however it should be copy and paste if the platform enables raw HTML inputs. Your mailer should look similar to this in the platform you are using.

Final Thoughts

The purpose of this walkthrough is to educate direct mailers on the possibilities of utilizing merge variables in an automated mailing campaign. For any additional help or insight, feel free to send me an email at: [email protected] or hit us up on Twitter: @directmailerio

In the near future, DirectMailer.io will be offering a platform to manage your direct mailing campaigns as well as integrate into your CRM or 3rd party system for additional engagement. For more information on that, check out: directmailer.io/platform

If you have any additional question about leverging merge variables in your next campaign, or how DirectMailer.io can cover your direct mailing needs from the note pad to the mail box, and everywhere in between please schedule a free consultation or send us a message here.