How To Create 100 Unique MOO MiniCards
A few weeks back, the nice people at MOO got in touch because they’d seen some of the MiniCards we’d produced to help promote Perch, and thought we might make an interesting case study to go along with their new range of MiniCards that enable you to upload images for both the front and back. You can read the case study over at the MOO blog, and whilst it was fun to get a sneak preview of a new product from one of my favourite companies, that’s not what this post is about.
What was interesting about our cards was that each card carries a unique, single-use discount code. The way MiniCards work is that you can upload a bunch of images to go on the front, but the back of each card is the same. So while most people upload a small handful of photos from Flickr and end up with a few cards with each, to get 100 unique cards per batch we were faced with generating and uploading 100 unique images to go on the front.
The first stage of the problem was generating unique codes. The Perch checkout system has an option for discount codes, but this needed to be adapted to allow for single-use codes rather than general, time limited codes. It’s our own custom system, so that was easy to do, and so I set about writing a quick command-line PHP script to generate unique discount codes and put them into the database. So our codes were sorted – what about all those images.
I’m a long time Adobe Fireworks user, and Fireworks has this great little tool called the Data-Driven Graphics Wizard. This is probably based likened to Mail Merge for graphics. You create a template graphics file with placeholders in it (stuff like {name}
, {address}
and so on), and then provide a data source with fields that match your placeholders. The merge process outputs a folder full of unique images using the document’s Save for Web settings.
The only downside is that the data source Fireworks needs is an XML file. User expectation would be that CSV would be the tool for the job here, but XML is what it wants, so I updated my discount code generation script to output an XML doc with all the codes at the end of each batch. The output looked something like this:
ABC123EF ABC123EG …Each row only had one field called ‘code’. This meant I needed to create my graphic with {code}
placeholder text for where I wanted the discount code to sit. I hit go, and out came 100 unique images to upload to MOO.
Admittedly, the process at MOO isn’t optimised for uploading 100 unique images per batch of 100 MiniCards, so that part of the process was a little laborious, but that’s really my own fault. It’d be great if, for example, MOO had the option to upload a single ZIP of images.
But that’s all there is to it. I hope that’s useful to someone. By the way, the above discount codes aren’t real, but you can use the code WOOHOO1.2 until tomorrow (23rd Oct 2009) for a 20% discount off the new version of Perch. The update is free to existing customers.