Module: Roda::RodaPlugins::MailerPreview

Defined in:
lib/roda/plugins/mailer_preview.rb

Overview

The mailer_preview plugin provides an HTML representation of the email without requiring it to be delivered through SMTP.

plugin :mailer_preview

Preview email

To preview an email, create a route which finishes by calling preview with an instance of a Mail object.

r.on "previews" do
  r.is "signup-email" do
    mail = YourMailer.mail("/signup-email")
    preview(mail)
  end
end

Preview index

For a single point of entry to all your mail previews, provide an array of paths to preview_index

r.is "previews" do
  available_previews = ["/previews/signup-email"]
  preview_index(available_previews)
end

Defined Under Namespace

Modules: InstanceMethods

Class Method Summary collapse

Class Method Details

.load_dependencies(app, opts = {}) ⇒ Object

:nodoc:



64
65
66
# File 'lib/roda/plugins/mailer_preview.rb', line 64

def self.load_dependencies(app, opts = {}) # :nodoc:
  app.plugin :render
end