ahoy_email 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/ahoy_email.rb +5 -2
- data/lib/ahoy_email/observer.rb +7 -0
- data/lib/ahoy_email/processor.rb +1 -1
- data/lib/ahoy_email/tracker.rb +5 -7
- data/lib/ahoy_email/version.rb +1 -1
- metadata +2 -2
- data/lib/ahoy_email/interceptor.rb +0 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 042ad39e2a371bd33d437f9187d691b665ae267c664703656baa3f7c40612fac
|
4
|
+
data.tar.gz: bf6e213b94b8002cd53767272cbdd1a2ea16ac24008c47439e9376615cde04db
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f7d589c0b45ac51efaaf7045d4578810c47524ec43a6ea8a82e65c1d975e86aba45abd8e73d0f6c6a0b7d999cd1e352ffae8113df347de81ecda3108982fd4c2
|
7
|
+
data.tar.gz: '0598b1f93fde1645f490e8ab4f02032520f707045b651dfb857b02bad78573b26d1b84f9e317a86c2c9e1126e078d43b1f2e0bc93db3e5fee14db60c6afd08e0'
|
data/CHANGELOG.md
CHANGED
data/lib/ahoy_email.rb
CHANGED
@@ -8,7 +8,7 @@ require "safely/core"
|
|
8
8
|
# modules
|
9
9
|
require "ahoy_email/processor"
|
10
10
|
require "ahoy_email/tracker"
|
11
|
-
require "ahoy_email/
|
11
|
+
require "ahoy_email/observer"
|
12
12
|
require "ahoy_email/mailer"
|
13
13
|
require "ahoy_email/version"
|
14
14
|
require "ahoy_email/engine" if defined?(Rails)
|
@@ -58,6 +58,8 @@ module AhoyEmail
|
|
58
58
|
|
59
59
|
ahoy_message.sent_at = Time.now
|
60
60
|
ahoy_message.save!
|
61
|
+
|
62
|
+
ahoy_message
|
61
63
|
end
|
62
64
|
|
63
65
|
self.subscribers = []
|
@@ -73,5 +75,6 @@ end
|
|
73
75
|
|
74
76
|
ActiveSupport.on_load(:action_mailer) do
|
75
77
|
include AhoyEmail::Mailer
|
76
|
-
|
78
|
+
register_observer AhoyEmail::Observer
|
79
|
+
Mail::Message.attr_accessor :ahoy_data, :ahoy_message
|
77
80
|
end
|
data/lib/ahoy_email/processor.rb
CHANGED
data/lib/ahoy_email/tracker.rb
CHANGED
@@ -7,15 +7,13 @@ module AhoyEmail
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def perform
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
data
|
14
|
-
AhoyEmail.track_method.call(data)
|
10
|
+
Safely.safely do
|
11
|
+
# perform_deliveries check still needed in observer
|
12
|
+
if message.perform_deliveries && message.ahoy_data
|
13
|
+
data = message.ahoy_data.merge(message: message)
|
14
|
+
message.ahoy_message = AhoyEmail.track_method.call(data)
|
15
15
|
end
|
16
16
|
end
|
17
|
-
ensure
|
18
|
-
message["Ahoy-Message"] = nil if message["Ahoy-Message"]
|
19
17
|
end
|
20
18
|
end
|
21
19
|
end
|
data/lib/ahoy_email/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ahoy_email
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kane
|
@@ -179,8 +179,8 @@ files:
|
|
179
179
|
- config/routes.rb
|
180
180
|
- lib/ahoy_email.rb
|
181
181
|
- lib/ahoy_email/engine.rb
|
182
|
-
- lib/ahoy_email/interceptor.rb
|
183
182
|
- lib/ahoy_email/mailer.rb
|
183
|
+
- lib/ahoy_email/observer.rb
|
184
184
|
- lib/ahoy_email/processor.rb
|
185
185
|
- lib/ahoy_email/tracker.rb
|
186
186
|
- lib/ahoy_email/version.rb
|