Performing a Mail Merge with Google Docs (To Create Documents or Emails)

Google Docs is wonderful in many ways, however, there are a couple of areas where it has limited functionality that were issues for me recently and this is the second of a two-part series of blog posts (see the first part here) on what I did to work around those limitations.

A Google Docs mail merge is not a native capability of Google Docs. Said another way, Google Docs does not natively offer the ability to do a mail merge (that is, it does not offer the ability to use a template document with special data placeholders and create a set of documents from a set of data where the data is used to populate the values for the special data placeholders in the template document). Fortunately, Google Docs does natively offer the ability to use 3rd party extensions and the excellent DocumentMerge by PandaDoc extension will allow you to do mail merges.

The instructions for how to use DocumentMerge by PandaDoc to perform a mail merge using a Google Sheet as the data source for a template Google Doc can be found at I won't belabor things by repeating the instructions here; the reason I'm writing this post is that for me, the DocumentMerge by PandaDoc extension wasn't easy to find when searching for a way to do a mail merge with Google Docs and I'm hoping that this blog post will bubble up in search results in the future, making it easier for others to find the extension (if this blog post is helpful to you, please take a moment to leave a comment if you're willing). To be more specific, what I was looking for was the ability to do a mail merge that produced printable documents but all I was able to find was info on how to do mail merges to create emails (which the DocumentMerge by PandaDoc extension will do as well so if that's what you're looking for, it's good for that too).

Anyway, it's a great extension for doing a mail merge with Google Docs (though for some reason it's fairly slow). You'll see that it creates a Google Doc as the output of your mail merge and from there, that document is just like any other Google Doc (meaning you can download it, print it, whatever you need to do). In addition, DocumentMerge by PandaDoc has another capability as well: if you want to email out each of the merged documents as a PDF attached to an email, you can do that directly with DocumentMerge by PandDoc which is a great feature (albeit one I haven't used since in my case I just needed to print the merged documents).

PDF Portfolios & ColdFusion 9

I think that one of the coolest features in ColdFusion 9 is the ability to create PDF Portfolios. But this feature isn't one that I hear anyone talking about. Why? Well, I find that most ColdFusion developers--and I've talked to a whole lot about this--have never heard of PDF Portfolios. So what I need to do here first is point you to some info about PDF Portfolios themselves.

The best place to start is with this Adobe Acrobat 9 help documentation. Check out all those cool features!

Let's say you need ColdFusion 9 to send multiple pieces of content via email. Your options:

  1. Attach all the items to the email. This is messy.
  2. Put the items in a ZIP file and attach it to the email. Good luck getting this through email filters!
  3. Put the items in a PDF Package and attach it to the email. Your user gets a single attached file, opens it with Adobe Acrobat 9 or Adobe Reader 9 and browses through the content, even previewing it directly within Adobe Acrobat 9 or Adobe Reader 9!

Let's say you need a user to be able to get multiple logically connected pieces of content from your ColdFusion 9 web app; perhaps you even need to allow the user to select the pieces of content himself/herself. Your options:

  1. Display links to all the content; have your user click the link for each piece of content he/she wants. This is messy, plus the user has to do the work to keep the content logically connected when saving the content locally.
  2. Put the items in a ZIP file and display a link to it. This works and in certain situations may be the best approach, however the display of a ZIP file is rather bland.
  3. Put the items in a PDF Package and display a link to it. Your user gets a single file and, in many browsers, this file will open automatically for viewing with Adobe Acrobat 9 or Adobe Reader 9.

Starting to see how cool and useful PDF Packages can be? Want to see their use in action? Check out the related post linked below: you'll see that I have provided a link to the code for the PresentasticPlus app (and yes, that code is in a ZIP file but that's because ZIP files make sense for code) and in that app there is functionality for dynamically creating a PDF Package based on a user's selection(s).

I should point out that ColdFusion 9 creates a sub-type of a PDF Portfolio known as a PDF Package. Really, the main difference is that PDF Portfolios can have a custom user interface and PDF Packages can't (for more information on this, see this blog post from the LiveCycle Doc team). This is a cool feature and I recommend you learn more about how you can use it with Adobe Acrobat 9 (see Joel Geraci on Adobe TV).

BlogCFC was created by Raymond Camden. This blog is running version 5.9.002. Contact Blog Owner