As mentioned in the previous post, Teambox now supports incoming email with webhooks. This allows users to create conversations, answer notifications and comment on tasks by email.

This is a technical post, so you may want to skip it unless you’re a programmer.

About processing incoming email

If you are running an application server in Ruby on Rails, PHP, Java or Python, it can be hard to connect your web application to email servers.

Some applications like mailman allow you to connect incoming email servers to your application, but then you need your own email server.

How to receive email without setting up an email server

For this, we’ll be using Sendgrid’s email servers. Sendgrid not only allows you to send email, but also to set up an MX mail server that turns incoming emails into POST requests. POST requests can be then processed by your application to process email instantly.

This means that you can set up a route on your application, and Sendgrid will ping www.yourserver.com/process with the From, To, Subject and Body parameters of the email. Your application can then use its logic to turn that into emails.

This is the way it works:

  1. First we set up a Sendgrid account.
  2. Once we’re logged in, we visit http://sendgrid.com/developer/reply.
  3. We will be accepting every address like *@reply.yourapp.com. For this, enter “reply.yourapp.com” in Hostname and “http://yourapp.com/process” in URL.
  4. Good. Now we need to set up a DNS record that tells users that emails sent to whatever@reply.yourapp.com need to be sent to Sendgrid’s mail server. For this, open your DNS settings and create an MX record for “reply.yourapp.com.” pointing to “mx.sendgrid.net.”.
  5. Wait some hours for the DNS to propagate. You can check it with “host reply.yourapp.com”. If it returns “mx.sendgrid.net”, it means you can use it. (It may take up to one day for Gmail and others to accept the changes).

Now, whenever you send an email to that address, your application will receive a notifications. You can check this on the server logs.

Example code for receiving emails

This is an example Ruby on Rails snippet that could handle incoming email. For the sake of simplicity, I’m skipping the validations, which should return an error code to Sendgrid in case the parameters are malformed, not present or invalid.

  
def post_from_email
  from    = params[:from]
  to      = params[:to]
  body    = params[:text]
  subject = params[:subject]

  body   += "\n\nThis email had #{params[:attachments]} attachments"

  project = Project.find_by_permalink to.split("@").first

  project.post_conversation(
    :user => User.find_by_email(from),
    :subject => subject,
    :body => body)
end
  

Check your application logs to know with certainty how notifications are being processed.

In case of doubt, read Teambox’s source code and Sendgrid’s documentation for incoming email.

Some cool features: Sendgrid will retry sending emails until it gets a 200 response code, so no email is ever lost. It supports attachments, too!

Turbocharged incoming email

Pablo Villalba July 29 2010 Comments

Teambox has supported processing incoming email since its beginning. Before, it would take some seconds to process this email, so users where left with the uncertainty of not knowing if it went through.

Today, we’ve taken incoming email to a new level. Email is now processed instantly, so it’s as good as posting an email reply on the web interface.

Technically, we do this by converting emails into webhooks. Instead of receiving emails on a normal POP3 or IMAP mail server, and then polling for changes every minute, we used Sendgrid to convert them into first-class application notifications that are processed instantly.

instant-email-replies

Try it

Send an email to yourprojectname@app.teambox.com and refresh Teambox on your browser. You’ll have a new conversation! More email commands available here.

This will soon allow you to email attachments directly into Teambox, too!

Attention to details

Pablo Villalba July 29 2010 Comments

This had bothered me for some time: When a comment on Teambox spanned across several paragraphs, it would be very hard to answer. I would have to scroll up to certain section of the message and down to my comment box to reply.

The same applied to conversations on GMail and other apps.

This is how I solved it: Really long conversations now collapse to a fixed height, and have a scrolling bar to navigate through them. Still shows normally short ones, and it makes it much easier to reply without constantly scrolling up and down.

It’s also a one line fix: max-height: 350px

Do you know about other UI that adapt to unexpected content in a smart way? Share it on the comments.

scrolling

zero2infinity soars with Teambox

Pablo Villalba July 28 2010 Comments

Ever wondered how our planet looks from above? Beyond the noise of the city, far away from the ground, past the atmosphere where we’ve always lived.

zero2infinity takes passengers somewhere over the rainbow, way up high. They are launching into the experiential travel business with a revolutionary Near-Space vehicle that will offer breathtaking views of our planet, so far only available to a privileged few.

You will be able to see the blue Earth and black Space from the comfort of a pressurized gondola being lifted by a balloon. This is the safest way to do it, while being environmentally friendly.

“We have already flown a nano-bloon, the first prototype which took high definition pictures and video”, said Jose Mariano López-Urdiales. “We will soon be flying a small mammal, then a larger mammal, and finally human beings.” Commercial flights are planned to start in 2014. The picture above is from a flight of their prototype, nano-bloon, carrying the Spanish soccer team’s jersey after their victory against Germany in the semi-final match of the 2010 World Cup.

Jose Mariano Lopez-Urdiales

“Starting up such an innovative project can get pretty hectic, managing contacts and work. It’s overwhelming!

Teambox really helped us getting everything in order. We always comment on tasks to keep everyone up to date on our status”

We asked Jose Mariano, which are your favorite Teambox features?

Files: “Before, we would email files to the whole group. This was especially troublesome when multiple people are working on the same file. You have to make sure that you edit the most recent one. Teambox lets you upload files. This way you always know where to find them and which one is the most recent.”

Replacing email: “You can alert other people to a task other than the person it’s assigned to. Simply by typing @ and the person’s user name in the task. It is really useful if you think the person you assigned the task to might need help.”

Tasks by context: “With our iterative design process, it was easy to confuse documents between the different iterations. In Teambox both tasks and documents are separated into Projects, saving us the time we would spend sorting through files until finding the correct one for a specific prototype.”

bloon-viaje-globo

Learn more about zero2infinity’s project

Request your API invitation now

Pablo Villalba July 28 2010 Comments

api-v1

The requests to connect 3rd party applications to Teambox keep flooding in.

Developers are asking for a way to connect their own systems, post notifications or develop their own mobile and desktop clients.

We hear you and are almost ready to make it so! We’ve been in the lap working on this for the last several weeks, and are happy to say that we are about to release the official API version 1.0 documentation. It will be full of both examples and Ruby libraries.

We’ve been working on this for the last weeks, and we will soon release the official API version 1.0 documentation with examples and Ruby libraries.

If you would like to test before it’s officially launched, follow the link below:

Request your invitation to test the API before it’s officially released.

Latest Posts