Tuesday, May 31, 2011

New Feature: Transactional Email Event API

We're pleased to launch the Event API for JangoSMTP, a system that can call any web service or web page on your server upon a specified event. The following events can trigger a call to your web service:
  1. A sent email
  2. An open of an email
  3. A click of a URL in an email
  4. An unsubscribe
  5. A bounce
  6. A complaint, via Feedback Loop
Why is this important?

Using the event-triggered API, you can now easily sync transactional email data with your own database or CRM system. You only need one script on your web server to handle the calls from JangoSMTP. The calls from JangoSMTP are made in real-time of an event happening.

How do I set this up?

To set up event-based web service calls, go to Settings --> Advanced and click on the Edit Button to the right of Transactional Event API.

Check the boxes next to the events to which you would like calls made and specify what URL should be called, with what parameters, and with what action type, POST or GET.

How is the Event API different from the Standard API?

The standard API, available at http://api.jangomail.com, allows a programmer to interact with JangoSMTP much like a user would interact with JangoSMTP through the web-based interface. You can pull reporting data, and send transactional email through the standard API. The event API pushes data to your system when an event like a click or an open happens. The standard API needs to be polled by your system to retrieve open or click data.

Other useful notes:

  1. If there are 1,000 consecutive failures when calling a specific web service for a specific event, then calls to the web service will cease until the URL or one of the parameters is modified. A failure is any HTTP response that is not status 200.
  2. When you first designate a web service and its attributes, JangoSMTP will call the web service for the last seven days worth of data. So if you specify a web service for the "open" event today, open data from the last seven days will immediately be posted to the web service.
  3. The parameter values will be URL-encoded before they are passed to your web service via HTTP POST or GET.
  4. You need not specify all parameters for a particular event. You only need to specify those parameters whose values you'd like your web service to receive.
  5. Every time JangoSMTP makes a call to your web service, it is recorded in the Event API Log, which can be viewed under Reports --> Logs --> Transactional Event API. From here you can see a list of all successful and failed calls to your web service.