Method: MultiMail::Message::SendGrid#sendgrid_content

Defined in:
lib/multi_mail/sendgrid/message.rb

#sendgrid_contentHash

Returns the attachments' content IDs in SendGrid format.

Returns:

  • (Hash)

    the content IDs in SendGrid format



36
37
38
39
40
41
42
43
44
45
46
# File 'lib/multi_mail/sendgrid/message.rb', line 36

def sendgrid_content
  hash = {}
  attachments.each do |attachment|
    if attachment.content_type.start_with?('image/')
      # Mirror Mailgun behavior for naming inline attachments.
      # @see http://documentation.mailgun.com/user_manual.html#inline-image
      hash[attachment.filename] = attachment.filename
    end
  end
  hash
end