Skip to content

Instantly share code, notes, and snippets.

@nunommc
nunommc / staging.rb
Last active November 12, 2015 12:02 — forked from lengarvey/staging.rb
Enabling Rails 4.1 mail previews in staging (or any other env besides development)
# put this in your staging.rb file. Obviously you'll need more config than this it's just an example.
Rails.application.configure do
config.action_mailer.preview_path ||= defined?(Rails.root) ? "#{Rails.root}/spec/mailers/previews" : nil
config.action_mailer.show_previews = true
end
# Without the following would display "For security purposes, this information is only available to local requests"
class ::Rails::MailersController
include Rails.application.routes.url_helpers