Building a template that loops through difficult data...


So, I have an interesting templating issue, whereby I have been supplied with a very long list of returns data for a hire car company. It's currently based on the following fields (columns in an excel sheet):

"Company Name" - "First Name" - "Last Name" - "Email Address" - "Car Reg Number" - "Date to Return"

For example, a few rows could contain the following:

John Smith Ltd - John - Smith - - JHN5555 - 29/05/2014
John Smith Ltd - John - Smith - - JHN5556 - 30/05/2014
Vin Diesel Ltd - Vin - Diesel - - 2F2F99 - 01/06/2014

So basically, John has to bring back his 2 hire cars on the 29th of May and then on the 30th of May. One user, like John, could have many cars out on hire.

Using Campaign Monitor, is there a simple way to loop through the entire Excel sheet, and send the returns email to each user based on email address? i.e. John Smith Ltd, gets an email send to and it only shows him his 2 cars due for return. Vin Diesel also gets an email, but it only shows him his returns.

Thanks for the help!

Clicky Clicky, 2 years ago

HI Adam, not a complete solution - but have you considered using Excel to move the registration number and due date to become additional columns for each user? You could then import them into Campaign Monitor, and display all additional data at once, not having to loop through anything. Of course the limitation here, is if you have a limited number of custom fields available, so it depends how many cars people lease at once!

Hopefully that's somewhat helpful.

Clicky! A marketing agency that loves email so much that's all we do.
adamlunn, 2 years ago

Great stuff, thanks!

I ended up restructuring the data, but the limit of 50 custom fields has meant I can't add as many returns as I wanted. Ah well, I'm just glad it's 50 now - it was 15 not so long ago!

Clicky Clicky, 2 years ago

Yeah - I was wondering that! Well that's about 25 cars, unless you put date & registration in the same field... How many did you get to fit in?

Clicky! A marketing agency that loves email so much that's all we do.

Join 200,000 companies around the world that use Campaign Monitor to run email marketing campaigns that deliver results for their business.

Get started for free