-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrails.diff
More file actions
31 lines (28 loc) · 1.34 KB
/
rails.diff
File metadata and controls
31 lines (28 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
diff --git a/actionmailer/lib/action_mailer/railtie.rb b/actionmailer/lib/action_mailer/railtie.rb
index 70c4937c418b2..bd87fe1057f90 100644
--- a/actionmailer/lib/action_mailer/railtie.rb
+++ b/actionmailer/lib/action_mailer/railtie.rb
@@ -23,7 +23,6 @@ class Railtie < Rails::Railtie # :nodoc:
options.stylesheets_dir ||= paths["public/stylesheets"].first
options.show_previews = Rails.env.development? if options.show_previews.nil?
options.cache_store ||= Rails.cache
- options.smtp_settings ||= {}
if options.show_previews
options.preview_path ||= defined?(Rails.root) ? "#{Rails.root}/test/mailers/previews" : nil
@@ -46,9 +45,15 @@ class Railtie < Rails::Railtie # :nodoc:
self.delivery_job = delivery_job.constantize
end
- if smtp_timeout = options.delete(:smtp_timeout)
- options.smtp_settings[:open_timeout] ||= smtp_timeout
- options.smtp_settings[:read_timeout] ||= smtp_timeout
+ if options.smtp_settings
+ self.smtp_settings = options.smtp_settings
+ end
+
+ smtp_timeout = options.delete(:smtp_timeout)
+
+ if self.smtp_settings && smtp_timeout
+ self.smtp_settings[:open_timeout] ||= smtp_timeout
+ self.smtp_settings[:read_timeout] ||= smtp_timeout
end
options.each { |k, v| send("#{k}=", v) }