actionmailer_interceptor 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5f5546c6477326029c26062a61c8463e89b39d55
4
- data.tar.gz: e69e9d3b1786cc9852c9b2609cb5aff8b54482dd
3
+ metadata.gz: b7260e94044417696b2016067a03a2a16fcd9654
4
+ data.tar.gz: 7581f4560fb73c694d1250250e6d668b65f0e177
5
5
  SHA512:
6
- metadata.gz: 8920f5025fa79642216cac02faa1e33a661510e0983274ae46114e10b55c0a12519621cfe7a7a6ebd57c8d8c44e19eb718c6fc4a83f266442418cfab0e982d8e
7
- data.tar.gz: 10c2c1704bb4a6744b8b257e03ff941b2ded4f1c8fcf613f40ad2b6b4f91cfc66b4855a3d6451e97240e44943877a45436fc7daf097cab9bc8b860ff4b1c2f66
6
+ metadata.gz: 5f0623ee5f5d2d382cb927b4c1013208df8badaddea38972bc3816b5ee2ff28b54682a7da54a996b1b936812aa0430a84685b1c30491ea25e54a625274f90995
7
+ data.tar.gz: bb2c1f075deac8d5303228fff6daad9a4cd936d28e8a64384d00d8caab26a28bbb88ec108cacf114dce18243b17022632e42589b6793b0af4df4b7f2e6304d21
data/README.md CHANGED
@@ -10,9 +10,7 @@ in Gemfile:
10
10
  in `config/initializers/actionmailer_interceptor.rb`:
11
11
 
12
12
  ```
13
- interceptor = ActionmailerInterceptor::MailerInterceptor.new(redirection_email: 'my_email@example.com')
14
-
15
- if Rails.env.development? || Rails.env.staging?
16
- ActionMailer::Base.register_interceptor(interceptor)
13
+ if ENV['redirection_email']
14
+ ActionMailer::Base.register_interceptor(ActionmailerInterceptor::MailInterceptor)
17
15
  end
18
16
  ```
@@ -1,19 +1,21 @@
1
- class ActionmailerInterceptor::MailInterceptor
2
- attr_accessor :redirection_email
1
+ module ActionmailerInterceptor
2
+ class MailInterceptor
3
+ attr_accessor :redirection_email
3
4
 
4
- def initialize(options={})
5
- @redirection_email = options[:redirection_email]
6
- end
5
+ def initialize(options={})
6
+ @redirection_email = options[:redirection_email]
7
+ end
7
8
 
8
- def self.delivering_email(message)
9
- original_recipients = ' ['
10
- [:to, :cc, :bcc].each do |field|
11
- unless message.send(field).blank?
12
- original_recipients << "#{field}: #{message.send(field).join(', ')}"
9
+ def self.delivering_email(message)
10
+ original_recipients = ' ['
11
+ [:to, :cc, :bcc].each do |field|
12
+ unless message.send(field).blank?
13
+ original_recipients << "#{field}: #{message.send(field).join(', ')}"
14
+ end
13
15
  end
16
+ original_recipients << ']'
17
+ message.subject += original_recipients
18
+ message.to = @redirection_email
14
19
  end
15
- original_recipients << ']'
16
- message.subject += original_recipients
17
- message.to = @redirection_email
18
20
  end
19
21
  end
@@ -1,3 +1,3 @@
1
1
  module ActionmailerInterceptor
2
- VERSION = '0.0.3'
2
+ VERSION = '0.0.4'
3
3
  end
File without changes
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: actionmailer_interceptor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marko Bošković
@@ -53,6 +53,7 @@ files:
53
53
  - lib/actionmailer_interceptor.rb
54
54
  - lib/actionmailer_interceptor/mail_interceptor.rb
55
55
  - lib/actionmailer_interceptor/version.rb
56
+ - lib/generators/actionmailer_interceptor.rb
56
57
  homepage: https://github.com/bosskovic/actionmailer_interceptor
57
58
  licenses:
58
59
  - MIT