actionmailer_interceptor 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5f5546c6477326029c26062a61c8463e89b39d55
|
4
|
+
data.tar.gz: e69e9d3b1786cc9852c9b2609cb5aff8b54482dd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8920f5025fa79642216cac02faa1e33a661510e0983274ae46114e10b55c0a12519621cfe7a7a6ebd57c8d8c44e19eb718c6fc4a83f266442418cfab0e982d8e
|
7
|
+
data.tar.gz: 10c2c1704bb4a6744b8b257e03ff941b2ded4f1c8fcf613f40ad2b6b4f91cfc66b4855a3d6451e97240e44943877a45436fc7daf097cab9bc8b860ff4b1c2f66
|
@@ -1,21 +1,19 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
attr_accessor :redirection_email
|
1
|
+
class ActionmailerInterceptor::MailInterceptor
|
2
|
+
attr_accessor :redirection_email
|
4
3
|
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
def initialize(options={})
|
5
|
+
@redirection_email = options[:redirection_email]
|
6
|
+
end
|
8
7
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
end
|
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(', ')}"
|
15
13
|
end
|
16
|
-
original_recipients << ']'
|
17
|
-
message.subject += original_recipients
|
18
|
-
message.to = @redirection_email
|
19
14
|
end
|
15
|
+
original_recipients << ']'
|
16
|
+
message.subject += original_recipients
|
17
|
+
message.to = @redirection_email
|
20
18
|
end
|
21
19
|
end
|