These docs are for v0.1.0. Click to read the latest docs for v1.0.0.

Front.fetchDraft(callback)

Sends you the draft of the current conversation. If the conversation has no draft, the draft value in the callback will be null. Otherwise, it will look like any other message object representation.

callback: function

A callback function.

Front.fetchDraft(function (draft) {
    console.log(draft);
});

Sample JSON for a draft

{
  "attachments" : [],
  "ext_id" : "[email protected]",
  "status" : "draft-compose",
  "id" : "msg_4zd7",
  "body" : "<div>Some HTML body</div>",
  "inbound" : false,
  "recipients" : [
    {
      "display_name" : "Awesome recipient",
      "role" : "from",
      "handle" : "[email protected]"
    }
  ],
  "from" : {
    "display_name" : "A teammate",
    "handle": "[email protected]"
  },
  "date" : 1493391443349,
  "blurb" : "Some HTML body",
  "type" : "email",
  "subject" : "Re: a message"
}