Email Your Goals Using Ruby, Google Docs, SendGrid, and

Email Your Goals Using Ruby, Google Docs, SendGrid, and

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 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 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 up and running we’ll need to clone the repository and start interacting with it.

git clone daily-goals
cd daily-goals

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

Creating a new 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 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 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.

More Posts by Nick
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.