From 84ed7b8dfeb2ba47ca8c1b0767c85bbf200e786b Mon Sep 17 00:00:00 2001
From: Leonard Garvey <lengarvey@gmail.com>
Date: Mon, 30 Jun 2014 00:12:25 +1000
Subject: Add configuration to enable mail previews

Adds `config.action_mailer.preview_enabled`

This allows mail previewing to be enabled easily in non-development
environments such as staging. The default is set to true for development
so no changes should be required to existing Rails applications.

The mail preview path can still be configured using the existing
`config.action_mailer.preview_path` configuration option.

Adding this avoids devs from having to do stuff like:
https://gist.github.com/lengarvey/fa2c9bd6cdbeba96526a

Update actionmailer/CHANGELOG with new configuration.
Update configuring guide with new configuratation.
Add `config.action_mailer.preview_path` to configuring guide.
---
 guides/source/configuring.md | 12 ++++++++++++
 1 file changed, 12 insertions(+)

(limited to 'guides/source')

diff --git a/guides/source/configuring.md b/guides/source/configuring.md
index f74fbaa7c3..68f03c5430 100644
--- a/guides/source/configuring.md
+++ b/guides/source/configuring.md
@@ -453,6 +453,18 @@ There are a number of settings available on `config.action_mailer`:
     config.action_mailer.interceptors = ["MailInterceptor"]
     ```
 
+* `config.action_mailer.preview_path` specifies the location of mailer previews.
+
+    ```ruby
+    config.action_mailer.preview_path = "#{Rails.root}/lib/mailer_previews"
+    ```
+
+* `config.action_mailer.preview_enabled` enable or disable mailer previews. By default this is `true` in development.
+
+    ```ruby
+    config.action_mailer.preview_enabled = false
+    ```
+
 ### Configuring Active Support
 
 There are a few configuration options available in Active Support:
-- 
cgit v1.2.3