Class: Courrier::PreviewsController

Inherits:
ActionController::Base
  • Object
show all
Defined in:
app/controllers/courrier/previews_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



5
6
7
# File 'app/controllers/courrier/previews_controller.rb', line 5

def index
  @emails = emails.map { Courrier::Email::Providers::Inbox::Email.from_file(_1) }
end

#showObject



9
10
11
12
13
14
# File 'app/controllers/courrier/previews_controller.rb', line 9

def show
  file_path = File.join(Courrier.configuration.inbox.destination, params[:id])
  content = File.read(file_path)

  render html: content.html_safe, layout: false
end