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.



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

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

Instance Attribute Details

#emailObject (readonly)

Returns the value of attribute email.



4
5
6
# File 'lib/roadie/rails/mail_inliner.rb', line 4

def email
  @email
end

#optionsObject (readonly)

Returns the value of attribute options.



4
5
6
# File 'lib/roadie/rails/mail_inliner.rb', line 4

def options
  @options
end

Instance Method Details

#executeObject



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

def execute
  if options
    improve_body if email.content_type =~ /^text\/html/
    improve_html_part(email.html_part) if email.html_part
  end
  email
end