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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 98b36aef95156ff7e1938250d562849b11099b18
4
- data.tar.gz: 9b268aac653efb5427ccf133dabbd37418d3815a
3
+ metadata.gz: 0d467aa7543e2d533c9e235ddb1fd5d3a1df4ed3
4
+ data.tar.gz: 8574de8778ca3bd872e9c086d71e16e359851393
5
5
  SHA512:
6
- metadata.gz: 126c5fd727f97a61f9a84e99ba8a4fa12b587dc76ba4d21ad1d998ff57bc3f93f963292053b5fad70b4c4a0b90be0017c6978a7a63de3ef7c8ce15504221211b
7
- data.tar.gz: 979d1310f3b909296202075e000ec7ca3f3ca8e409934534919ced80bc14dc9b5673219acd862c53fedaeba82c0dd2789d29f8a929e951c8f5ec94db16c63e14
6
+ metadata.gz: 065864eae9303b91f59f5b3e86169c5e630866061dae2721683883f97e0b6cc9ec4ee40b565ca97e63aaa65600f9bff42b495a554521f234b1e88dcbdce34f63
7
+ data.tar.gz: baa96b0f8099d081ff591701ffd10395eb991cff4fefe7e88197f7412d4d33cdfc56ab25a48ae891f56aa2c8a6b61f05be7dcab2ae1aaf4ae5fe8e251a20c416
@@ -1,3 +1,8 @@
1
+ ## 0.3.2
2
+
3
+ - Fixed deprecation warning for Rails 5
4
+ - Do not track content by default on fresh installations
5
+
1
6
  ## 0.3.1
2
7
 
3
8
  - Fixed deprecation warnings
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
- # :message and :controller keys
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
- # same keys as above, plus :url
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
@@ -1,6 +1,10 @@
1
1
  module Ahoy
2
2
  class MessagesController < ActionController::Base
3
- before_filter :set_message
3
+ if respond_to? :before_action
4
+ before_action :set_message
5
+ else
6
+ before_filter :set_message
7
+ end
4
8
 
5
9
  def open
6
10
  if @message && !@message.opened_at
@@ -1,3 +1,3 @@
1
1
  module AhoyEmail
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
@@ -11,7 +11,7 @@ class <%= migration_class_name %> < ActiveRecord::Migration
11
11
  # optional - feel free to remove
12
12
  t.string :mailer
13
13
  t.text :subject
14
- t.text :content
14
+ # t.text :content
15
15
 
16
16
  # optional
17
17
  # t.string :utm_source
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.1
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-05-12 00:00:00.000000000 Z
11
+ date: 2016-07-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails