Class: Roadie::Rails::MailInliner

Inherits:
Object
  • Object
show all
Defined in:
lib/roadie/rails/mail_inliner.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(email, options) ⇒ MailInliner

Returns a new instance of MailInliner.



8
9
10
11
# File 'lib/roadie/rails/mail_inliner.rb', line 8

def initialize(email, options)
  @email = email
  @options = options
end

Instance Attribute Details

#emailObject (readonly)

Returns the value of attribute email.



6
7
8
# File 'lib/roadie/rails/mail_inliner.rb', line 6

def email
  @email
end

#optionsObject (readonly)

Returns the value of attribute options.



6
7
8
# File 'lib/roadie/rails/mail_inliner.rb', line 6

def options
  @options
end

Instance Method Details

#executeObject



13
14
15
16
17
18
19
# File 'lib/roadie/rails/mail_inliner.rb', line 13

def execute
  if options
    improve_body if %r{^text/html}.match?(email.content_type)
    improve_html_part(email.html_part) if email.html_part
  end
  email
end