3

i am trying to add label in ThreadView in Conversation. but nothing happen. SubjectList in my code is dynamic list of subjects.

here is a doc link: https://www.inboxsdk.com/docs/#ThreadView

InboxSDK.load(2, 'sdk_dfgdfgdfgdfgdfg').then(function(sdk){

    sdk.Conversations.registerThreadViewHandler(function(ThreadView){
      if(typeof SubjectList != 'undefined'){
        $.each(SubjectList,function(inx,val){
          var sub =  ThreadView.getSubject();
          if(val.Subject.trim() == sub.trim()){
            var ele = document.createElement("span");
            ele.innerHTML = "Test lable";
            ThreadView.addLabel({
              el: ele,
              destroyed: false
            });
            console.log(sub);
          }
        });
      }
    });
});
Mikhail Zhuikov
  • 1,213
  • 2
  • 9
  • 19

0 Answers0