mandriller 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0bd96554dfe341939a2ceeece84b87063baffbbe
4
- data.tar.gz: 46cc7feb2cb4b33d25cc330efe10eaf66286995c
3
+ metadata.gz: 1e882d4b5fa17b6061dfc6ed90a471cf0c9dd195
4
+ data.tar.gz: 9247bca77a75642a28bcfb36e606828513464383
5
5
  SHA512:
6
- metadata.gz: 9aa5682fef78ec085c4609425d1dfa3244db78e45dddb23857d57b3a2e2c5c72c29735b081b6bafe60684763f480e6fc1c024f444e61f4ca8e757c921cdd18a0
7
- data.tar.gz: 3ace4e02923f937852c4ac0c07618f280d7b70f99cc5a3e08987210a970779951cc170e5e66ee2ba5802d078cc29a6761225b44d7f7a6fb71dd0a6e156fdb341
6
+ metadata.gz: 21a027cabad51bd466a5f75b994f96f03b1635d96ac05c46e332574d584096e5131ee0ac3a5cdc45c00ea10aa2da7f80f98ebabecbaa420173a7f53be7659089
7
+ data.tar.gz: 6b9c6a4cc403f3230725490c6ca32dc495cecf7868059262a59cd797846f7dcacd1b44a0a756986fab4865577a7e9cf883eb7eb8c7fcd06933d3d07f17bb78d7
data/README.md CHANGED
@@ -46,9 +46,9 @@ Enable open-tracking for the message.
46
46
 
47
47
  Enable click-tracking for the message.
48
48
 
49
- `set_click_track 'clicks_all'`: enables click tracking on all emails
50
- `set_click_track 'clicks_htmlonly'`: enables click tracking only on html emails
51
- `set_click_track 'clicks_textonly'`: enables click tracking only on text emails
49
+ `set_click_track 'all'`: enables click tracking on all emails
50
+ `set_click_track 'htmlonly'`: enables click tracking only on html emails
51
+ `set_click_track 'textonly'`: enables click tracking only on text emails
52
52
 
53
53
  ### set_auto_text
54
54
 
@@ -31,7 +31,7 @@ class Mandriller::Base < ActionMailer::Base
31
31
  define_settings_methods STRING_SETTINGS.keys
32
32
  define_settings_methods JSON_SETTINGS.keys
33
33
  define_settings_methods :open_track, default: true
34
- define_settings_methods :click_track, default: 'clicks_all'
34
+ define_settings_methods :click_track, default: 'all'
35
35
  define_settings_methods :send_at
36
36
 
37
37
  class_attribute :mandrill_template, :mandrill_google_analytics
@@ -56,7 +56,12 @@ class Mandriller::Base < ActionMailer::Base
56
56
  end
57
57
 
58
58
  def mail(*args)
59
- tracks = [get_mandrill_setting("open_track") ? 'opens' : nil, get_mandrill_setting("click_track")].compact.map(&:to_s)
59
+ tracks = []
60
+ tracks << (get_mandrill_setting("open_track") ? 'opens' : nil)
61
+ if v = get_mandrill_setting("click_track")
62
+ tracks << "clicks_#{v}"
63
+ end
64
+ tracks = tracks.compact.map(&:to_s)
60
65
  unless tracks.empty?
61
66
  tracks.each do |track|
62
67
  validate_values!(track, %w(opens clicks_all clicks_htmlonly clicks_textonly))
@@ -1,3 +1,3 @@
1
1
  module Mandriller
2
- VERSION = '0.0.3'
2
+ VERSION = '0.0.4'
3
3
  end
@@ -165,20 +165,20 @@ describe Mandriller::Base do
165
165
  it_behaves_like "with header", 'X-MC-Track', 'opens'
166
166
  end
167
167
  context "set by #set_open_track" do
168
- let(:local_settings) { lambda{ set_click_track :clicks } }
169
- it_behaves_like "with header", 'X-MC-Track', 'clicks'
168
+ let(:local_settings) { lambda{ set_click_track :all } }
169
+ it_behaves_like "with header", 'X-MC-Track', 'clicks_all'
170
170
  context "invalid type" do
171
171
  let(:local_settings) { lambda{ set_click_track :invalid } }
172
172
  it_behaves_like "raise an exception", Mandriller::InvalidHeaderValue
173
173
  end
174
174
  end
175
175
  context "set by ::set_open_track" do
176
- let(:global_settings) { lambda{ set_click_track :clicks } }
177
- it_behaves_like "with header", 'X-MC-Track', 'clicks'
176
+ let(:global_settings) { lambda{ set_click_track :all } }
177
+ it_behaves_like "with header", 'X-MC-Track', 'clicks_all'
178
178
  end
179
179
  context "set by both ::set_open_track and ::set_click_track" do
180
- let(:global_settings) { lambda{ set_open_track; set_click_track :clicks } }
181
- it_behaves_like "with header", 'X-MC-Track', 'opens,clicks'
180
+ let(:global_settings) { lambda{ set_open_track; set_click_track :all } }
181
+ it_behaves_like "with header", 'X-MC-Track', 'opens,clicks_all'
182
182
  end
183
183
  end
184
184
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mandriller
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daisuke Taniwaki