Add tasks to todo.txt to do lists from Gmail using ifttt

UPDATE: I recently discovered that in Android, if you use voice search and start with “note to self,” it will email you with that as the subject line and the rest of what you say as the body. I updated my Gmail filter to label anything from me with the subject line “Note to self” as “todo.” This means I can now add to my to do list using my phone’s voice recognition.

[If you want to cut to the chase, here’s the ifttt recipe, so you don’t have to read anything else to do what the post’s title suggests.]

I am a massive fan of todo.txt. I’ve tried a LOT of to do list managers. Remember the Milk, Hive Minder, toodledoo, pen and paper, my email inbox, the built-in Blackberry and Outlook to do managers. There are probably more – those are just the ones I could think of in about a minute. For a person who is constantly in a terminal, todo.txt is the way to go.

It was created by Gina Trapani, former editor-in-chief of LifeHacker. It’s a shell script, that is basically just a glorified text editor, but it is a VERY specific text editor. I won’t get into its uses here, but you should definitely check it out, if anything about this post has peaked your interest.

One of my favorite things about todo.txt is that since it’s just storing your to do list in a plain text file, it can be kept in your Dropbox. That means the list is automatically synced across all of my computers. There’s also a todo.txt Android app. It costs a buck or two, but it’s totally worth the cost. There’s just one issue I’ve had with the Android app, and even generally with todo.txt: connectivity.

I have found that often my best time to think of stuff that I need to do is when I am commuting. Unfortunately, most of that is done underground, where I have no cell signal. The todo.txt app is still functional, but if I didn’t sync the file in my Dropbox right before I went underground, then I will have conflicting lists, and the stuff I added to my list between now and the last time I opened Dropbox or the todo.txt app on my phone will be overwritten.

I tried to think of a graceful way to get around this, and I couldn’t think of one. Instead, I was emailing myself and then updating the todo list when I got back to a computer. Then it occurred to me that I could write a script to automate this. THEN it occurred to me that I probably wouldn’t have to. Why? ifttt.

I have written about ifttt before, for auto-uploading docs to my Kindle. ifttt is a GREAT automation tool, and it integrates with both Gmail and Dropbox. I was able to get this whole thing working in about 5 minutes. Now, I can email myself stuff I need to do, and it will automatically be added to my to do list. Here’s how I did it:

Step 0: you need to be using todo.txt, Dropbox, and Gmail* already.

Additionally, your todo.txt to do list needs to be in your Dropbox somewhere. You will also need an account on ifttt. Don’t worry about linking all of these accounts together in advance – ifttt will ask you for what you need as you go. It’s very VERY straightforward.

*I don’t know if ifttt can work with other email providers; web (Yahoo, Hotmail, etc) or otherwise (POP3, or IMAP). I use Gmail, and ifttt works with Gmail. I wouldn’t be surprised if either it already does, or it will soon. ifttt adds new services often.

Step 1: set up an email filter

I created a filter in Gmail that states that anything that comes to me from my own Gmail address with the subject line “todo” will automatically have the label todo applied, and it will be Archived (NOT marked as read, but labeled and not put in my inbox.) This is fairly straightforward to do in Gmail, and you will certainly be able to find instructions on how to do this, so I won’t go into more specifics here.

Step 2: Create a task in ifttt

From the ifttt dashboard (the main screen when you log in), I clicked “Create a task.”

Step 3: “if THIS

Clicking as described will take you to a page that says “ifthisthenthat.” “This” will be a link. Click it.

Step 4: Gmail

Click the Gmail logo. If you haven’t already linked your Gmail account to ifttt you will be taken through the setup for that. It’s very straightforward, and if you can’t figure it out, there will certainly be a help on the site.

Step 5: “New email labeled”

Click that. It will take you to a form with one input field. That’s where you input the label to watch. In this case, I used (as described above) “todo,” so that’s what I entered here (without quotes), and hit the “Create trigger” button.

Step 6: “that”

You will now see “if[Gmail logo]thenthat” and “that” will be a link (like “this” was before). Click it.

Step 7: Dropbox

Click the Dropbox logo. Again, if you haven’t already linked your Dropbox account, you will be taken to the setup; just like Gmail.

Step 8: “Append to a text file”

CLICK THE RIGHT ONE. This is the most important step. Make sure you click “Append to a text file” otherwise, you run the risk of blowing away your entire to do list!

Step 9: The most daunting part.

Then you’ll be taken to a form you need to fill out. Here’s what I did:

File name: todo.txt (unless you are doing some very complicated stuff with todo.txt, in which case you should be able to figure this field out anyway, you will enter todo.txt here.)

Dropbox folder path: todo

In the root of my Dropbox folder is a folder called todo. This is where my file todo.txt lives. If that isn’t where yours is going, change accordingly.

Content: “BodyPlain”

There’s a lot going on in this box by default. ifttt allows you to pull in all kinds of stuff from the emails it is monitoring in your “todo” label. All we really care about is the body of the email (unless you want to get fancy), so get rid of everything except the “BodyPlain” button thing.

Click “Create action”

Step 10: Name your ifttt rule.

Enter the name into the Description field, and click “Create task.”

Step 11: Sit back and relax

Actually, step 11 should be test this, to make sure everything is working as expected. So unless you trust me a lot, don’t just sit back and relax. That can be Step 12.Alternatively, you can just use the ifttt recipe I created, which will do all of this for you.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s