email_preview 1.5.0 → 1.5.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -7,10 +7,14 @@ 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"))
10
+
11
+ previous_delivery_method = ActionMailer::Base.delivery_method
12
+ begin
13
+ ActionMailer::Base.delivery_method = EmailPreview.delivery_method if EmailPreview.delivery_method
14
+ @mail.deliver
15
+ ensure
16
+ ActionMailer::Base.delivery_method = previous_delivery_method
12
17
  end
13
- @mail.deliver
14
18
  redirect_to details_email_preview_path(params[:id])
15
19
  end
16
20
  def preview
@@ -1,3 +1,3 @@
1
1
  module EmailPreview
2
- VERSION = "1.5.0"
2
+ VERSION = "1.5.1"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: email_preview
3
3
  version: !ruby/object:Gem::Version
4
- hash: 3
4
+ hash: 1
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 5
9
- - 0
10
- version: 1.5.0
9
+ - 1
10
+ version: 1.5.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ryan Sonnek