Class: Mailer::Email

Inherits:
TMail::Mail
  • Object
show all
Defined in:
lib/mailer/email.rb

Overview

this class inherits from TMail::Mail and just adds some niceties to it

Instance Method Summary collapse

Instance Method Details

#part_of_body(part_content_type) ⇒ Object

a way to return just a part of a multipart body, if it is multipart



10
11
12
13
14
15
16
# File 'lib/mailer/email.rb', line 10

def part_of_body(part_content_type)
  if multipart? && (part = parts.select{|part| part.content_type == part_content_type}.try(:first))
    part.body
  else
    body
  end
end