Module: Teamlab::MailConversations

Included in:
Mail
Defined in:
lib/teamlab/modules/mail/mail_conversations.rb

Overview

Methods for working with mail conversations

Instance Method Summary collapse

Instance Method Details

#add_tag_to_conversations(tag_id, *conversation_ids) ⇒ Object



46
47
48
# File 'lib/teamlab/modules/mail/mail_conversations.rb', line 46

def add_tag_to_conversations(tag_id, *conversation_ids)
  @request.put(['conversations', 'tag', tag_id.to_s, 'set'], messages: conversation_ids.flatten)
end

#chain_crm_linked_by_message?(message_id) ⇒ Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/teamlab/modules/mail/mail_conversations.rb', line 18

def chain_crm_linked_by_message?(message_id)
  @request.get(%w[conversations link crm status], messageId: message_id)
end

#get_filtered_conversations(options = {}) ⇒ Object



6
7
8
# File 'lib/teamlab/modules/mail/mail_conversations.rb', line 6

def get_filtered_conversations(options = {})
  @request.get(%w[conversations], options)
end

#get_messages_linked_into_one_chain(message_id, load_all_content) ⇒ Object



10
11
12
# File 'lib/teamlab/modules/mail/mail_conversations.rb', line 10

def get_messages_linked_into_one_chain(message_id, load_all_content)
  @request.get(['conversation', message_id.to_s], loadAllContent: load_all_content)
end

#get_previous_or_next_conversation_id(id, direction, options = {}) ⇒ Object



14
15
16
# File 'lib/teamlab/modules/mail/mail_conversations.rb', line 14

def get_previous_or_next_conversation_id(id, direction, options = {})
  @request.get(['conversation', id.to_s, direction.to_s], options)
end

#mark_conversation_as_crm_linked(message_id, *crm_contact_ids) ⇒ Object



38
39
40
# File 'lib/teamlab/modules/mail/mail_conversations.rb', line 38

def mark_conversation_as_crm_linked(message_id, *crm_contact_ids)
  @request.put(%w[conversations crm mark], messageId: message_id, crmContactIds: crm_contact_ids.flatten)
end

#move_conversations_to_folder(folder_id, *message_ids) ⇒ Object



22
23
24
# File 'lib/teamlab/modules/mail/mail_conversations.rb', line 22

def move_conversations_to_folder(folder_id, *message_ids)
  @request.put(%w[conversations move], folderId: folder_id, ids: message_ids.flatten)
end

#remove_conversations(*ids) ⇒ Object



30
31
32
# File 'lib/teamlab/modules/mail/mail_conversations.rb', line 30

def remove_conversations(*ids)
  @request.put(%w[conversations remove], ids: ids.flatten)
end

#remove_tag_from_conversations(tag_id, *conversation_ids) ⇒ Object



50
51
52
# File 'lib/teamlab/modules/mail/mail_conversations.rb', line 50

def remove_tag_from_conversations(tag_id, *conversation_ids)
  @request.put(['conversations', 'tag', tag_id.to_s, 'unset'], messages: conversation_ids.flatten)
end

#restore_conversations_to_folders(*ids) ⇒ Object



34
35
36
# File 'lib/teamlab/modules/mail/mail_conversations.rb', line 34

def restore_conversations_to_folders(*ids)
  @request.put(%w[conversations restore], ids: ids.flatten)
end

#set_conversations_status(status, *ids) ⇒ Object



26
27
28
# File 'lib/teamlab/modules/mail/mail_conversations.rb', line 26

def set_conversations_status(status, *ids)
  @request.put(%w[conversations mark], status: status, ids: ids.flatten)
end


42
43
44
# File 'lib/teamlab/modules/mail/mail_conversations.rb', line 42

def unmark_conversation_link_with_crm(message_id, *crm_contact_ids)
  @request.put(%w[conversations crm unmark], messageId: message_id, crmContactIds: crm_contact_ids.flatten)
end