Module: Teamlab::MailConversations
- Included in:
- Defined in:
- lib/teamlab/modules/mail/mail_conversations.rb
Overview
Methods for working with mail conversations
Instance Method Summary collapse
- #add_tag_to_conversations(tag_id, *conversation_ids) ⇒ Object
- #chain_crm_linked_by_message?(message_id) ⇒ Boolean
- #get_filtered_conversations(options = {}) ⇒ Object
- #get_messages_linked_into_one_chain(message_id, load_all_content) ⇒ Object
- #get_previous_or_next_conversation_id(id, direction, options = {}) ⇒ Object
- #mark_conversation_as_crm_linked(message_id, *crm_contact_ids) ⇒ Object
- #move_conversations_to_folder(folder_id, *message_ids) ⇒ Object
- #remove_conversations(*ids) ⇒ Object
- #remove_tag_from_conversations(tag_id, *conversation_ids) ⇒ Object
- #restore_conversations_to_folders(*ids) ⇒ Object
- #set_conversations_status(status, *ids) ⇒ Object
- #unmark_conversation_link_with_crm(message_id, *crm_contact_ids) ⇒ Object
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
18 19 20 |
# File 'lib/teamlab/modules/mail/mail_conversations.rb', line 18 def () @request.get(%w[conversations link crm status], messageId: ) end |
#get_filtered_conversations(options = {}) ⇒ Object
6 7 8 |
# File 'lib/teamlab/modules/mail/mail_conversations.rb', line 6 def get_filtered_conversations( = {}) @request.get(%w[conversations], ) 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 (, load_all_content) @request.get(['conversation', .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, = {}) @request.get(['conversation', id.to_s, direction.to_s], ) 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(, *crm_contact_ids) @request.put(%w[conversations crm mark], messageId: , 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, *) @request.put(%w[conversations move], folderId: folder_id, 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 |
#unmark_conversation_link_with_crm(message_id, *crm_contact_ids) ⇒ Object
42 43 44 |
# File 'lib/teamlab/modules/mail/mail_conversations.rb', line 42 def unmark_conversation_link_with_crm(, *crm_contact_ids) @request.put(%w[conversations crm unmark], messageId: , crmContactIds: crm_contact_ids.flatten) end |