Class: Mail::Message

Inherits:
Object
  • Object
show all
Includes:
Postmark::SharedMessageExtensions
Defined in:
lib/postmark/message_extensions/mail.rb

Instance Method Summary collapse

Instance Method Details

#body_htmlObject



10
11
12
13
14
15
16
# File 'lib/postmark/message_extensions/mail.rb', line 10

def body_html
  if html_part.nil?
    body.to_s if html?
  else
    html_part.body.to_s
  end
end

#body_textObject



18
19
20
21
22
23
24
# File 'lib/postmark/message_extensions/mail.rb', line 18

def body_text
  if text_part.nil?
    body.to_s
  else
    text_part.body.to_s
  end
end

#html?Boolean



6
7
8
# File 'lib/postmark/message_extensions/mail.rb', line 6

def html?
  content_type.include?('text/html')
end