Class: EmlToPdf::Email

Inherits:
Object
  • Object
show all
Defined in:
lib/eml_to_pdf/email.rb

Constant Summary collapse

TEMPLATES_PATH =
Pathname.new(File.expand_path(__dir__)) + 'templates'

Instance Method Summary collapse

Constructor Details

#initialize(email_provider) ⇒ Email

Returns a new instance of Email.



9
10
11
# File 'lib/eml_to_pdf/email.rb', line 9

def initialize(email_provider)
  @mail = email_provider.email
end

Instance Method Details

#to_htmlObject



13
14
15
16
17
18
19
20
21
# File 'lib/eml_to_pdf/email.rb', line 13

def to_html
  extraction = ExtractionStep.new(@mail)
  extraction = extraction.next until extraction.finished?
  html = extraction.to_html
  html = resolve_cids_from_attachments(html, @mail.all_parts)
  html = disable_links(html) unless links_enabled?
  html = (@mail, html) if display_metadata?
  html
end