mail_interceptor 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -1
- data/lib/mail_interceptor.rb +0 -3
- data/lib/mail_interceptor/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 691b985934a4d8d914973c060939febba013f974
|
4
|
+
data.tar.gz: ce02faa6ca1925dba811e607ceb5b015e7ce10da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1d47f4ab350a5a78dbc0628edb983ad02a867aefd72893284012efe6e62284596120c1e7dcf7ead1022bd64bff723de6fcbb93830dd1217cbe2180566e22da70
|
7
|
+
data.tar.gz: fe81f686a1df5e724f94380cf7ed94375e573df5a310f5c7900f0485d8331fdeb4f73043532e4e2b9263eb070628a202c38e6d8ccefe99439e2b7c8d6589f25b
|
data/README.md
CHANGED
@@ -28,9 +28,14 @@ options = { forward_emails_to: 'intercepted_emails@domain.com',
|
|
28
28
|
subject_prefix: 'WHEEL' }
|
29
29
|
|
30
30
|
interceptor = MailInterceptor::Interceptor.new(options)
|
31
|
-
|
31
|
+
unless Rails.env.test?
|
32
|
+
ActionMailer::Base.register_interceptor(interceptor)
|
33
|
+
end
|
32
34
|
```
|
33
35
|
|
36
|
+
Do not use this feature in test mode so that in your tests
|
37
|
+
you can test against real recipients of the email.
|
38
|
+
|
34
39
|
### deliver_emails_to
|
35
40
|
|
36
41
|
Passing __deliver_emails_to__ is optional. If no "deliver_emails_to"
|
data/lib/mail_interceptor.rb
CHANGED
@@ -39,7 +39,6 @@ module MailInterceptor
|
|
39
39
|
|
40
40
|
def add_subject_prefix message
|
41
41
|
return if subject_prefix.blank?
|
42
|
-
return if !env.intercept?
|
43
42
|
|
44
43
|
message.subject = "#{subject_prefix} #{message.subject}"
|
45
44
|
end
|
@@ -70,8 +69,6 @@ module MailInterceptor
|
|
70
69
|
end
|
71
70
|
|
72
71
|
def intercept?
|
73
|
-
return false if Rails.env.test?
|
74
|
-
|
75
72
|
!Rails.env.production?
|
76
73
|
end
|
77
74
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mail_interceptor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Neeraj Singh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|