ahoy_email 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +18 -8
- data/app/controllers/ahoy/messages_controller.rb +5 -1
- data/lib/ahoy_email/version.rb +1 -1
- data/lib/generators/ahoy_email/templates/install.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: 0d467aa7543e2d533c9e235ddb1fd5d3a1df4ed3
|
4
|
+
data.tar.gz: 8574de8778ca3bd872e9c086d71e16e359851393
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 065864eae9303b91f59f5b3e86169c5e630866061dae2721683883f97e0b6cc9ec4ee40b565ca97e63aaa65600f9bff42b495a554521f234b1e88dcbdce34f63
|
7
|
+
data.tar.gz: baa96b0f8099d081ff591701ffd10395eb991cff4fefe7e88197f7412d4d33cdfc56ab25a48ae891f56aa2c8a6b61f05be7dcab2ae1aaf4ae5fe8e251a20c416
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -179,19 +179,29 @@ Subscribe to open and click events. Create an initializer `config/initializers/a
|
|
179
179
|
|
180
180
|
```ruby
|
181
181
|
class EmailSubscriber
|
182
|
-
|
183
182
|
def open(event)
|
184
|
-
#
|
185
|
-
ahoy = event[:controller].ahoy
|
186
|
-
ahoy.track "Email opened", message_id: event[:message].id
|
183
|
+
# any code you want
|
187
184
|
end
|
188
185
|
|
189
186
|
def click(event)
|
190
|
-
#
|
191
|
-
ahoy = event[:controller].ahoy
|
192
|
-
ahoy.track "Email clicked", message_id: event[:message].id, url: event[:url]
|
187
|
+
# any code you want
|
193
188
|
end
|
189
|
+
end
|
194
190
|
|
191
|
+
AhoyEmail.subscribers << EmailSubscriber.new
|
192
|
+
```
|
193
|
+
|
194
|
+
Here’s an example if you use [Ahoy](https://github.com/ankane/ahoy) to track visits and events:
|
195
|
+
|
196
|
+
```ruby
|
197
|
+
class EmailSubscriber
|
198
|
+
def open(event)
|
199
|
+
event[:controller].ahoy.track "Email opened", message_id: event[:message].id
|
200
|
+
end
|
201
|
+
|
202
|
+
def click(event)
|
203
|
+
event[:controller].ahoy.track "Email clicked", message_id: event[:message].id, url: event[:url]
|
204
|
+
end
|
195
205
|
end
|
196
206
|
|
197
207
|
AhoyEmail.subscribers << EmailSubscriber.new
|
@@ -202,7 +212,7 @@ AhoyEmail.subscribers << EmailSubscriber.new
|
|
202
212
|
You can use a `Proc` for any option.
|
203
213
|
|
204
214
|
```ruby
|
205
|
-
track utm_campaign: proc{|message, mailer| mailer.action_name + Time.now.year }
|
215
|
+
track utm_campaign: proc { |message, mailer| mailer.action_name + Time.now.year }
|
206
216
|
```
|
207
217
|
|
208
218
|
Disable tracking for an email
|
data/lib/ahoy_email/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ahoy_email
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kane
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-07-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|