Fun with Google Sheets API

I've been playing around with the Google Sheets API to automate some mundane pages. I can't really take credit for figuring out the connection in version 3 of the API. That credit goes to Karl Kranich. From what I can tell, this version was short lived and seems experimental. Just as I got this working Google releases the version 4 API and says we should all use that.... Oh well, I'll move on to that one on my next project, this is already done for now. The good news though is that version 4 seems to have much better documentation and reliability, so I think when I'm ready to move over, it will be fairly simple.

For now, I wanted to post this in case it helps anyone else who has started the process. Like I said, the main guts of this script I can't take credit for, that goes to Karl Kranich at karl.kranich.org. He made the connection to Google. Around line 167 is my work which takes the cell values, makes a multi-dimenstional array and then echoes some HTML using those values. It's really simple to generate a page of floated DIVs, but I'm having trouble figuring out an elegant way to use these values in some responsive email templates. I'll get it eventually though... When I do I'll update this.

For now, download the files here.

Here is the end result using the sheet format below.

Download