Class: MultiMail::Message::Base

Inherits:
Mail::Message show all
Defined in:
lib/multi_mail/message/base.rb

Direct Known Subclasses

Mailgun, Mandrill, Postmark, SendGrid

Instance Method Summary collapse

Instance Method Details

#body_htmlObject



9
10
11
12
13
14
15
# File 'lib/multi_mail/message/base.rb', line 9

def body_html
  if html_part
    html_part.body.decoded
  elsif html?
    body.decoded
  end
end

#body_textObject



17
18
19
20
21
22
23
# File 'lib/multi_mail/message/base.rb', line 17

def body_text
  if text_part
    text_part.body.decoded
  elsif !html?
    body.decoded
  end
end

#html?Boolean



5
6
7
# File 'lib/multi_mail/message/base.rb', line 5

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

#tagsObject



25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/multi_mail/message/base.rb', line 25

def tags
  if self['tag']
    if self['tag'].respond_to?(:map)
      self['tag'].map do |field|
        field.value
      end
    else
      [self['tag'].value]
    end
  else
    []
  end
end