Email API Documentation

Making a new Obindo inbox app is easy. You can be up-and-running with a new inbox within a couple of minutes. To create yours, follow these steps.

  1. Sign up for an Obindo developer account here.
  2. Create your new inbox here.
  3. Obindo will turn every email that gets sent to that inbox into a json object. With this object, you can access the basics of the email (to, from, subject, etc) as well as any data that Obindo has extracted from the message (such as people, dates, tags, and so on.)
  4. Use the scripting engine to write the actions you would like to be run each time an email is sent to that inbox. The json object Obindo creates is available to you in your script as a global variable message.

That's all there is to it! Once your script is complete and your inbox is created, you can begin sending messages to <your-inbox-name>@obindo.com.

To show how this works in practice, let's start with something very simple. If all we want to do is send a message back to a sender, we could write:
/*
* This sample Obindo script simply sends a note back to the sender.
*/

sendEmail(message.from.emailAddress, 'Re: ' + message.subject, 'You wrote: ' + message.text);
But let's say we wanted to get a little bit more clever and write a script which looked at some of the information in the email and did something with it. In that case, we might write something like this:
/*!
* This sample Obindo script parses out a few pieces of information
* and sends a short note back to the sender.
*/

// First, let's grab some basic information from the incoming email
var fromAddress = message.from.emailAddress;
var subject = message.subject;
var body = message.body;

// Next, let's see if there is anything like contacts, files, or photos in the email.
var contacts = message.names;
var files = message.files;

// Then, let's create a short note...
var text = "Hi from Obindo!\n";
if ( contacts != null )
 for (var i=0; i < contacts.length; i++)
   text += "\nYour email included a contact " + contacts[i].name;

if ( files != null )
 for (var i=0; i < files.length; i++)
   text += "\nAnd it also included this file: " + files[i].name;

// And send that note back to the sender.
sendEmail (fromAddress, "Hi from Obindo!", text );
The possibilities are endless. Here are some resources to learn how to take things a little further:

  • Parsing Email Messages: The message object allows us an easy way to access elements of an incoming email.
  • Email Authentication and OAuth2: Connect email to your app using OAuth 2 so that you can easily push data from email messages into another app.
  • Methods: All javascript methods available to you for your scripts.
  • Cookbook Recipes: A few helpful code snippets to get you started.
  • Questions: Answers to a few questions we've received.
  • Security: Remarks on the security of email processing.