class HelpScout::Conversation::Thread
Conversation::Thread
developer.helpscout.net/objects/conversation/thread/
Name Type Example Notes id Int 88171881 Unique identifier assignedTo Person User of the Help Scout user to which this conversation has been assigned. status String active Status of the thread. Thread status is only updated when there is a status change. Otherwise, the status will be set to STATUS_NO_CHANGE. createdAt DateTime 2012-07-23T12:34:12Z UTC time when this thread was created. createdBy Person Either the Customer or User that created this conversation. Inspect the Source object for clarification. source Source fromMailbox Mailbox If the conversation was moved, fromMailbox represents the Mailbox from which it was moved. type String message The type of thread. state String published The state of the thread. customer Person If type is message, this is the Customer of the customer in which the message was sent. If type is customer, this is the Customer of the customer that initiated the thread. body String Thank you. to Array Collection of Strings representing emails. cc Array Collection of Strings representing emails. bcc Array Collection of Strings representing emails. attachments Array Collection of Attachment objects, if they exist.
Possible values for state include:
A state of STATE_UNDER_REVIEW
means the thread has been stopped by Traffic Cop and is waiting to be confirmed (or discarded) by the person that created the thread.
Traffic Cop is the Help Scout feature that stops a thread from going out if multiple Users act on the same Help Scout simultaneously.
Possible values for status include:
Possible values for type include:
TYPE_LINEITEM
represents a change of state on the conversation. This could include, but not limited to, the conversation was assigned, the status changed, the conversation was moved from one mailbox to another, etc. A line item won't have a body, to/cc/bcc lists, or attachments.
When a conversation is forwarded, a new conversation is created to represent the forwarded conversation.
-
TYPE_FWD_PARENT
is the type set on the thread of the original conversation that initiated the forward event. -
TYPE_FWD_CHILD
is the type set on the first thread of the new forwarded conversation.
Constants
- STATE_DRAFT
- STATE_PUBLISHED
- STATE_UNDER_REVIEW
- STATUS_ACTIVE
- STATUS_CLOSED
- STATUS_NO_CHANGE
- STATUS_PENDING
- STATUS_SPAM
- TYPE_CUSTOMER
- TYPE_FWD_CHILD
- TYPE_FWD_PARENT
- TYPE_LINEITEM
- TYPE_MESSAGE
- TYPE_NOTE
Attributes
Public Class Methods
Creates a new Conversation::Thread
object from a Hash of attributes
# File lib/helpscout/models.rb, line 315 def initialize(object) @createdAt = DateTime.iso8601(object["createdAt"]) if object["createdAt"] @id = object["id"] @assignedTo = Person.new(object["assignedTo"]) if object["assignedTo"] @createdBy = Person.new(object["createdBy"]) if object["createdBy"] @status = object["status"] @source = Source.new(object["source"]) if object["source"] @fromMailbox = Mailbox.new(object["fromMailbox"]) if object["fromMailbox"] @type = object["type"] @state = object["state"] @customer = Person.new(object["customer"]) if object["customer"] @body = object["body"] @to = object["to"] @cc = object["cc"] @bcc = object["bcc"] @attachments = [] if object["attachments"] object["attachments"].each do |item| @attachments << Attachment.new(item) end end end
Public Instance Methods
Returns a String suitable for display
# File lib/helpscout/models.rb, line 341 def to_s "#{@customer}: #{@body}" end