Email Client Controller

This controller contains callbacks specific to certain clients. These are invoked to customise the presentation of certain UI elements of that client.

loadThreadListView (listInfo, supportedTemplates)

Invoked by the Red Sift Gmail client to customise the presentation of the thread list view, in your web mail client.

Parameters:

  • listInfo: object, the list value emitted by the Sift's DAG for the given thread id, under the list attribute, more info here
  • supportedTemplates: array, the supported templates for the Gmail client. Currently 001_list_common_txt and 003_list_common_img are supported.

Returns:

  • a template object (see examples below)
loadThreadListView (listInfo, supportedTemplates) {
  var label = '';
  if(listInfo.converted === true) {
    label += '~';
  }
  label += listInfo.currency + listInfo.total;
  var ret = {
    template: '001_list_common_txt',
    value: {
      subtitle: label,
      color: '#000000',
      backgroundColor = '#ffbb00'
    }
  };
  return ret;
};

📘

Synchronous Responses

This method only supports synchronous responses in order not to affect the UI performance.

Thread and Message list view templates

We currently support two common templates: 001_list_common_txt and 003_list_common_img.

001_list_common_txt:

// skeleton for '001_list_common_txt' template
var result = {
  template: "001_list_common_txt",
  value: {
    subtitle": "£16.28",
    color: "#000000",
    backgroundColor":"#ffbb00"
  }
}

Presentation:

1131

003_list_common_img:

// skeleton for '003_list_common_img' template
var result = {
  template: "003_list_common_img",
  value: {
    image: {
      url: "assets/square_s.png"
    },
    subtitle: "3 social ids"
  }
}

Presentation:

1058