Email Your Goals Using Ruby, Google Docs, SendGrid, and Iron.io


Posted on

With the New Year fast approaching, you, like me, may be considering your goals for the upcoming year. For me, the hardest part about goals is remembering them. I’ll often make them and forget I did. So rather than buy echinacea, I decided to write a hack!

The hack, which I’m calling Daily Goals, emails you every day with a selection of your goals for personal growth. It’s written in Ruby and relies on Iron.io to run it every day.

The Code

All the code you need to get this working is on GitHub. I’ll highlight the key lines with links below.

I decided to keep my goals in a spreadsheet in Google Drive so that I can easily change them as I need to. Luckily, there’s a gem to interact with the service. Using this gem we can log into Google, grab the spreadsheet, and read the list of goals. From there we select a random goal from each category. Once we have our goals from Google, all that’s left is to throw it into a nice email and send it off with SendGrid.

Use the Code

Since the code is already written, we just need to create a Google Spreadsheet and get Iron.io to run it every day.

First, create a Google Spreadsheet. In the first row, put the categories for your goals (e.g. Personal, Professional). In subsequent rows, simply list the goals you have (ex). Save the document and make note of the key parameter in the URL–you’ll need this later.

To get Iron.io up and running we’ll need to clone the repository and start interacting with it.

git clone https://github.com/nquinlan/daily-goals.git daily-goals
cd daily-goals

Then we’ll need to create a new project in Iron.io. Log in to the dashboard and click “New Project.” Name your project and hit “create.”

Creating a new Iron.io Project

Once it’s been created, download your credentials as an iron.json file. Move the file to the cloned repository.

Project Credentials

Next, we’ll need to upload this to Iron.io and, assuming you have the IronWorker CLI installed, this is relatively simple. The CLI will take a bunch of information from the .worker file in the repository and then make the code through Iron.io. Note: as it’s a “remote” build, it will take a long time to build.

iron_worker upload DailyGoal

Finally, we’ll schedule code to run. To do this, open the IronWorker interface. Go to the scheduled tasks pane and create a new task. Schedule it to run daily (at whatever time you want to receive the email), in the area for “Payload” put a JSON document with your credentials and settings (your spreadsheet key and email) a sample can be found in the repository.

Congratulations! You’re done, a selection of your goals will now be emailed to you daily. If you’d like additional information more can be found on Github.


Nick Quinlan is a SendGrid Developer Evangelist based out of San Francisco. He works to make developers lives easier by providing them with the help they need to grow their ideas. Give him a shout, @YayNickQ.

2 thoughts on “Email Your Goals Using Ruby, Google Docs, SendGrid, and Iron.io

  1. Pingback: Keep your New Year's Resolution to Code More

  2. Pingback: Email Productivity Hacks Powered By SendGrid

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>