Class: Mailtrap::InboundMessage

Inherits:
Struct
  • Object
show all
Defined in:
lib/mailtrap/inbound_message.rb

Overview

Data Transfer Object for an inbound message (summary in list, full details when fetched by ID) rubocop:disable Lint/StructNewOverride -- size is an API field that shadows Struct#size

Instance Attribute Summary collapse

Instance Attribute Details

#attachmentsArray<InboundAttachment> (readonly)

The message attachments

Returns:



29
30
31
# File 'lib/mailtrap/inbound_message.rb', line 29

def attachments
  @attachments
end

#bccArray<String> (readonly)

Bcc addresses

Returns:

  • (Array<String>)

    the current value of bcc



29
30
31
# File 'lib/mailtrap/inbound_message.rb', line 29

def bcc
  @bcc
end

#ccArray<String> (readonly)

Cc addresses

Returns:

  • (Array<String>)

    the current value of cc



29
30
31
# File 'lib/mailtrap/inbound_message.rb', line 29

def cc
  @cc
end

#fromString? (readonly)

Sender address

Returns:

  • (String, nil)

    the current value of from



29
30
31
# File 'lib/mailtrap/inbound_message.rb', line 29

def from
  @from
end

#headersHash? (readonly)

Raw message headers

Returns:

  • (Hash, nil)

    the current value of headers



29
30
31
# File 'lib/mailtrap/inbound_message.rb', line 29

def headers
  @headers
end

#html_bodyString? (readonly)

Decoded HTML body (only when fetched by ID)

Returns:

  • (String, nil)

    the current value of html_body



29
30
31
# File 'lib/mailtrap/inbound_message.rb', line 29

def html_body
  @html_body
end

#html_sizeInteger? (readonly)

HTML body size in bytes

Returns:

  • (Integer, nil)

    the current value of html_size



29
30
31
# File 'lib/mailtrap/inbound_message.rb', line 29

def html_size
  @html_size
end

#idString (readonly)

The Mailtrap object ID (not the RFC Message-ID header)

Returns:

  • (String)

    the current value of id



29
30
31
# File 'lib/mailtrap/inbound_message.rb', line 29

def id
  @id
end

#in_reply_toString? (readonly)

Value of the RFC 5322 In-Reply-To header

Returns:

  • (String, nil)

    the current value of in_reply_to



29
30
31
# File 'lib/mailtrap/inbound_message.rb', line 29

def in_reply_to
  @in_reply_to
end

#inbox_idInteger (readonly)

The inbox the message was received in

Returns:

  • (Integer)

    the current value of inbox_id



29
30
31
# File 'lib/mailtrap/inbound_message.rb', line 29

def inbox_id
  @inbox_id
end

#raw_message_expires_atString? (readonly)

When the raw message URL expires (only when fetched by ID)

Returns:

  • (String, nil)

    the current value of raw_message_expires_at



29
30
31
# File 'lib/mailtrap/inbound_message.rb', line 29

def raw_message_expires_at
  @raw_message_expires_at
end

#raw_message_urlString? (readonly)

Signed URL to download raw .eml (only when fetched by ID)

Returns:

  • (String, nil)

    the current value of raw_message_url



29
30
31
# File 'lib/mailtrap/inbound_message.rb', line 29

def raw_message_url
  @raw_message_url
end

#received_atString (readonly)

ISO 8601 timestamp when the message was received

Returns:

  • (String)

    the current value of received_at



29
30
31
# File 'lib/mailtrap/inbound_message.rb', line 29

def received_at
  @received_at
end

#referencesArray<String> (readonly)

Values of the RFC 5322 References header

Returns:

  • (Array<String>)

    the current value of references



29
30
31
# File 'lib/mailtrap/inbound_message.rb', line 29

def references
  @references
end

#reply_toString? (readonly)

Reply-To address

Returns:

  • (String, nil)

    the current value of reply_to



29
30
31
# File 'lib/mailtrap/inbound_message.rb', line 29

def reply_to
  @reply_to
end

#rfc_message_idString? (readonly)

Value of the RFC 5322 Message-ID header

Returns:

  • (String, nil)

    the current value of rfc_message_id



29
30
31
# File 'lib/mailtrap/inbound_message.rb', line 29

def rfc_message_id
  @rfc_message_id
end

#sizeInteger? (readonly)

Total message size in bytes

Returns:

  • (Integer, nil)

    the current value of size



29
30
31
# File 'lib/mailtrap/inbound_message.rb', line 29

def size
  @size
end

#subjectString? (readonly)

Email subject

Returns:

  • (String, nil)

    the current value of subject



29
30
31
# File 'lib/mailtrap/inbound_message.rb', line 29

def subject
  @subject
end

#text_bodyString? (readonly)

Decoded text body (only when fetched by ID)

Returns:

  • (String, nil)

    the current value of text_body



29
30
31
# File 'lib/mailtrap/inbound_message.rb', line 29

def text_body
  @text_body
end

#text_sizeInteger? (readonly)

Text body size in bytes

Returns:

  • (Integer, nil)

    the current value of text_size



29
30
31
# File 'lib/mailtrap/inbound_message.rb', line 29

def text_size
  @text_size
end

#thread_idString? (readonly)

ID of the thread this message belongs to, if any

Returns:

  • (String, nil)

    the current value of thread_id



29
30
31
# File 'lib/mailtrap/inbound_message.rb', line 29

def thread_id
  @thread_id
end

#toArray<String> (readonly)

Recipient addresses

Returns:

  • (Array<String>)

    the current value of to



29
30
31
# File 'lib/mailtrap/inbound_message.rb', line 29

def to
  @to
end