Method: Mandrill::Messages#parse

Defined in:
lib/mandrill/api.rb

#parse(raw_message) ⇒ Hash

Parse the full MIME document for an email message, returning the content of the message broken into its constituent pieces

Parameters:

  • raw_message (String)

    the full MIME document of an email message

Returns:

  • (Hash)

    the parsed message

    • String

      subject the subject of the message

    • String

      from_email the email address of the sender

    • String

      from_name the alias of the sender (if any)

    • Array

      to an array of any recipients in the message

      - [Hash] to[] the information on a single recipient
          - [String] email the email address of the recipient
          - [String] name the alias of the recipient (if any)
      
    • Hash

      headers the key-value pairs of the MIME headers for the message’s main document

    • String

      text the text part of the message, if any

    • String

      html the HTML part of the message, if any

    • Array

      attachments an array of any attachments that can be found in the message

      - [Hash] attachments[] information about an individual attachment
          - [String] name the file name of the attachment
          - [String] type the MIME type of the attachment
          - [Boolean] binary if this is set to true, the attachment is not pure-text, and the content will be base64 encoded
          - [String] content the content of the attachment as a text string or a base64 encoded string based on the attachment type
      
    • Array

      images an array of any embedded images that can be found in the message

      - [Hash] images[] information about an individual image
          - [String] name the Content-ID of the embedded image
          - [String] type the MIME type of the image
          - [String] content the content of the image as a base64 encoded string
      


1081
1082
1083
1084
# File 'lib/mandrill/api.rb', line 1081

def parse(raw_message)
    _params = {:raw_message => raw_message}
    return @master.call 'messages/parse', _params
end