aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer/lib/action_mailer/preview.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionmailer/lib/action_mailer/preview.rb')
-rw-r--r--actionmailer/lib/action_mailer/preview.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/actionmailer/lib/action_mailer/preview.rb b/actionmailer/lib/action_mailer/preview.rb
index 33a9faa7e7..33de1dc049 100644
--- a/actionmailer/lib/action_mailer/preview.rb
+++ b/actionmailer/lib/action_mailer/preview.rb
@@ -11,6 +11,14 @@ module ActionMailer
#
mattr_accessor :preview_path, instance_writer: false
+ # Enable or disable mailer previews through app configuration:
+ #
+ # config.action_mailer.show_previews = true
+ #
+ # Defaults to true for development environment
+ #
+ mattr_accessor :show_previews, instance_writer: false
+
# :nodoc:
mattr_accessor :preview_interceptors, instance_writer: false
self.preview_interceptors = []
@@ -94,6 +102,10 @@ module ActionMailer
Base.preview_path
end
+ def show_previews #:nodoc:
+ Base.show_previews
+ end
+
def inform_preview_interceptors(message) #:nodoc:
Base.preview_interceptors.each do |interceptor|
interceptor.previewing_email(message)