email_preview 1.4.2 → 1.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +11 -0
- data/app/controllers/email_preview_controller.rb +3 -0
- data/lib/email_preview/version.rb +1 -1
- data/lib/email_preview.rb +1 -0
- metadata +4 -4
data/README.md
CHANGED
@@ -83,6 +83,17 @@ To make it available to other environments use:
|
|
83
83
|
EmailPreview.allowed_environments << 'production'
|
84
84
|
```
|
85
85
|
|
86
|
+
### (optional) set a different delivery method in development
|
87
|
+
|
88
|
+
By default emails are delivered with the delivery_method configured for your application.
|
89
|
+
You can override this so that if you use :test for development you can still deliver mails
|
90
|
+
when you use the send test email form.
|
91
|
+
|
92
|
+
```ruby
|
93
|
+
# config/environments/development.rb
|
94
|
+
EmailPreview.delivery_method = :smtp # or :sendmail, etc
|
95
|
+
ActionMailer::Base.smtp_settings = {:port => 12345} # additional configuration is optional
|
96
|
+
```
|
86
97
|
|
87
98
|
## Contributing
|
88
99
|
|
@@ -7,6 +7,9 @@ class EmailPreviewController < ApplicationController
|
|
7
7
|
|
8
8
|
def deliver
|
9
9
|
@mail.to params[:to]
|
10
|
+
if EmailPreview.delivery_method
|
11
|
+
@mail.delivery_method(ActionMailer::Base.delivery_methods[EmailPreview.delivery_method], ActionMailer::Base.send("#{EmailPreview.delivery_method}_settings"))
|
12
|
+
end
|
10
13
|
@mail.deliver
|
11
14
|
redirect_to details_email_preview_path(params[:id])
|
12
15
|
end
|
data/lib/email_preview.rb
CHANGED
@@ -9,6 +9,7 @@ module EmailPreview
|
|
9
9
|
attr_accessor :transactional
|
10
10
|
attr_accessor :logger
|
11
11
|
attr_accessor :before_preview_hook
|
12
|
+
attr_accessor :delivery_method
|
12
13
|
|
13
14
|
def register(description, options={}, &block)
|
14
15
|
fixture = EmailPreview::Fixture.new(description, options, &block)
|
metadata
CHANGED
@@ -5,9 +5,9 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 1.
|
8
|
+
- 5
|
9
|
+
- 0
|
10
|
+
version: 1.5.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Ryan Sonnek
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-
|
18
|
+
date: 2012-05-18 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
version_requirements: &id001 !ruby/object:Gem::Requirement
|