createsend 4.1.2 → 6.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/HISTORY.md +29 -0
- data/README.md +4 -4
- data/RELEASE.md +1 -1
- data/Rakefile +1 -1
- data/createsend.gemspec +1 -1
- data/lib/createsend/campaign.rb +1 -1
- data/lib/createsend/client.rb +25 -3
- data/lib/createsend/createsend.rb +3 -1
- data/lib/createsend/journey.rb +58 -0
- data/lib/createsend/list.rb +13 -12
- data/lib/createsend/segment.rb +3 -2
- data/lib/createsend/subscriber.rb +15 -10
- data/lib/createsend/version.rb +1 -1
- data/lib/createsend.rb +1 -0
- data/samples/authentication_sample.rb +64 -0
- data/samples/clients_sample.rb +79 -0
- data/samples/journey_sample.rb +87 -0
- data/samples/lists_sample.rb +41 -0
- data/samples/segments_sample.rb +21 -0
- data/samples/subscribes_sample.rb +22 -0
- data/test/administrator_test.rb +3 -3
- data/test/campaign_test.rb +6 -5
- data/test/client_test.rb +67 -36
- data/test/createsend_test.rb +4 -4
- data/test/fixtures/active_subscribers.json +5 -0
- data/test/fixtures/bounced_subscribers.json +1 -0
- data/test/fixtures/campaign_summary.json +2 -1
- data/test/fixtures/campaigns.json +37 -26
- data/test/fixtures/deleted_subscribers.json +5 -0
- data/test/fixtures/drafts.json +4 -2
- data/test/fixtures/journey_bounces.json +35 -0
- data/test/fixtures/journey_clicks.json +35 -0
- data/test/fixtures/journey_opens.json +55 -0
- data/test/fixtures/journey_recipients.json +27 -0
- data/test/fixtures/journey_summary.json +18 -0
- data/test/fixtures/journey_unsubscribes.json +26 -0
- data/test/fixtures/journeys.json +20 -0
- data/test/fixtures/scheduled_campaigns.json +4 -2
- data/test/fixtures/segment_subscribers.json +2 -0
- data/test/fixtures/subscriber_details.json +1 -0
- data/test/fixtures/subscriber_details_with_track_pref.json +23 -0
- data/test/fixtures/tags.json +10 -0
- data/test/fixtures/unconfirmed_subscribers.json +6 -2
- data/test/fixtures/unsubscribed_subscribers.json +6 -1
- data/test/helper.rb +3 -2
- data/test/journey_test.rb +156 -0
- data/test/list_test.rb +16 -9
- data/test/person_test.rb +3 -3
- data/test/segment_test.rb +2 -1
- data/test/subscriber_test.rb +22 -12
- metadata +25 -9
data/test/subscriber_test.rb
CHANGED
@@ -9,11 +9,12 @@ class SubscriberTest < Test::Unit::TestCase
|
|
9
9
|
|
10
10
|
should "get a subscriber by list id and email address" do
|
11
11
|
email = "subscriber@example.com"
|
12
|
-
stub_get(@auth, "subscribers/#{@list_id}.json?email=#{
|
12
|
+
stub_get(@auth, "subscribers/#{@list_id}.json?email=#{ERB::Util.url_encode(email)}&includetrackingpreference=false", "subscriber_details.json")
|
13
13
|
subscriber = CreateSend::Subscriber.get @auth, @list_id, email
|
14
14
|
subscriber.EmailAddress.should == email
|
15
15
|
subscriber.Name.should == "Subscriber One"
|
16
16
|
subscriber.Date.should == "2010-10-25 10:28:00"
|
17
|
+
subscriber.ListJoinedDate.should == "2010-10-25 10:28:00"
|
17
18
|
subscriber.State.should == "Active"
|
18
19
|
subscriber.CustomFields.size.should == 3
|
19
20
|
subscriber.CustomFields.first.Key.should == 'website'
|
@@ -21,16 +22,25 @@ class SubscriberTest < Test::Unit::TestCase
|
|
21
22
|
subscriber.ReadsEmailWith.should == "Gmail"
|
22
23
|
end
|
23
24
|
|
25
|
+
should "get a subscriber with track preference information" do
|
26
|
+
email = "subscriber@example.com"
|
27
|
+
stub_get(@auth, "subscribers/#{@list_id}.json?email=#{ERB::Util.url_encode(email)}&includetrackingpreference=true", "subscriber_details_with_track_pref.json")
|
28
|
+
subscriber = CreateSend::Subscriber.get @auth, @list_id, email, true
|
29
|
+
subscriber.EmailAddress.should == email
|
30
|
+
subscriber.Name.should == "Subscriber One"
|
31
|
+
subscriber.ConsentToTrack == "Yes"
|
32
|
+
end
|
33
|
+
|
24
34
|
should "add a subscriber without custom fields" do
|
25
35
|
stub_post(@auth, "subscribers/#{@list_id}.json", "add_subscriber.json")
|
26
|
-
email_address = CreateSend::Subscriber.add @auth, @list_id, "subscriber@example.com", "Subscriber", [], true
|
36
|
+
email_address = CreateSend::Subscriber.add @auth, @list_id, "subscriber@example.com", "Subscriber", [], true, "Yes"
|
27
37
|
email_address.should == "subscriber@example.com"
|
28
38
|
end
|
29
39
|
|
30
40
|
should "add a subscriber with custom fields" do
|
31
41
|
stub_post(@auth, "subscribers/#{@list_id}.json", "add_subscriber.json")
|
32
42
|
custom_fields = [ { :Key => 'website', :Value => 'http://example.com/' } ]
|
33
|
-
email_address = CreateSend::Subscriber.add @auth, @list_id, "subscriber@example.com", "Subscriber", custom_fields, true
|
43
|
+
email_address = CreateSend::Subscriber.add @auth, @list_id, "subscriber@example.com", "Subscriber", custom_fields, true, "Yes"
|
34
44
|
email_address.should == "subscriber@example.com"
|
35
45
|
end
|
36
46
|
|
@@ -39,25 +49,25 @@ class SubscriberTest < Test::Unit::TestCase
|
|
39
49
|
custom_fields = [ { :Key => 'multioptionselectone', :Value => 'myoption' },
|
40
50
|
{ :Key => 'multioptionselectmany', :Value => 'firstoption' },
|
41
51
|
{ :Key => 'multioptionselectmany', :Value => 'secondoption' } ]
|
42
|
-
email_address = CreateSend::Subscriber.add @auth, @list_id, "subscriber@example.com", "Subscriber", custom_fields, true
|
52
|
+
email_address = CreateSend::Subscriber.add @auth, @list_id, "subscriber@example.com", "Subscriber", custom_fields, true, "Yes"
|
43
53
|
email_address.should == "subscriber@example.com"
|
44
54
|
end
|
45
55
|
|
46
56
|
should "update a subscriber with custom fields" do
|
47
57
|
email = "subscriber@example.com"
|
48
58
|
new_email = "new_email_address@example.com"
|
49
|
-
stub_put(@auth, "subscribers/#{@list_id}.json?email=#{
|
59
|
+
stub_put(@auth, "subscribers/#{@list_id}.json?email=#{ERB::Util.url_encode(email)}", nil)
|
50
60
|
custom_fields = [ { :Key => 'website', :Value => 'http://example.com/' } ]
|
51
|
-
@subscriber.update new_email, "Subscriber", custom_fields, true
|
61
|
+
@subscriber.update new_email, "Subscriber", custom_fields, true, "Yes"
|
52
62
|
@subscriber.email_address.should == new_email
|
53
63
|
end
|
54
64
|
|
55
65
|
should "update a subscriber with custom fields including the clear option" do
|
56
66
|
email = "subscriber@example.com"
|
57
67
|
new_email = "new_email_address@example.com"
|
58
|
-
stub_put(@auth, "subscribers/#{@list_id}.json?email=#{
|
68
|
+
stub_put(@auth, "subscribers/#{@list_id}.json?email=#{ERB::Util.url_encode(email)}", nil)
|
59
69
|
custom_fields = [ { :Key => 'website', :Value => '', :Clear => true } ]
|
60
|
-
@subscriber.update new_email, "Subscriber", custom_fields, true
|
70
|
+
@subscriber.update new_email, "Subscriber", custom_fields, true, "No"
|
61
71
|
@subscriber.email_address.should == new_email
|
62
72
|
end
|
63
73
|
|
@@ -133,8 +143,8 @@ class SubscriberTest < Test::Unit::TestCase
|
|
133
143
|
{ :EmailAddress => "example+2@example.com", :Name => "Example Two" },
|
134
144
|
{ :EmailAddress => "example+3@example.com", :Name => "Example Three" },
|
135
145
|
]
|
136
|
-
lambda { import_result = CreateSend::Subscriber.import @auth, @list_id, subscribers,
|
137
|
-
}.should raise_error(CreateSend::BadRequest)
|
146
|
+
lambda { import_result = CreateSend::Subscriber.import @auth, @list_id, subscribers,
|
147
|
+
true }.should raise_error(CreateSend::BadRequest)
|
138
148
|
end
|
139
149
|
|
140
150
|
should "unsubscribe a subscriber" do
|
@@ -143,7 +153,7 @@ class SubscriberTest < Test::Unit::TestCase
|
|
143
153
|
end
|
144
154
|
|
145
155
|
should "get a subscriber's history" do
|
146
|
-
stub_get(@auth, "subscribers/#{@subscriber.list_id}/history.json?email=#{
|
156
|
+
stub_get(@auth, "subscribers/#{@subscriber.list_id}/history.json?email=#{ERB::Util.url_encode(@subscriber.email_address)}", "subscriber_history.json")
|
147
157
|
history = @subscriber.history
|
148
158
|
history.size.should == 1
|
149
159
|
history.first.Name.should == "Campaign One"
|
@@ -157,7 +167,7 @@ class SubscriberTest < Test::Unit::TestCase
|
|
157
167
|
end
|
158
168
|
|
159
169
|
should "delete a subscriber" do
|
160
|
-
stub_delete(@auth, "subscribers/#{@subscriber.list_id}.json?email=#{
|
170
|
+
stub_delete(@auth, "subscribers/#{@subscriber.list_id}.json?email=#{ERB::Util.url_encode(@subscriber.email_address)}", nil)
|
161
171
|
@subscriber.delete
|
162
172
|
end
|
163
173
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: createsend
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 6.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Dennes
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-02-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
61
|
+
version: 12.3.3
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
68
|
+
version: 12.3.3
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: fakeweb
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -174,6 +174,7 @@ files:
|
|
174
174
|
- lib/createsend/campaign.rb
|
175
175
|
- lib/createsend/client.rb
|
176
176
|
- lib/createsend/createsend.rb
|
177
|
+
- lib/createsend/journey.rb
|
177
178
|
- lib/createsend/list.rb
|
178
179
|
- lib/createsend/person.rb
|
179
180
|
- lib/createsend/segment.rb
|
@@ -183,6 +184,12 @@ files:
|
|
183
184
|
- lib/createsend/transactional_smart_email.rb
|
184
185
|
- lib/createsend/transactional_timeline.rb
|
185
186
|
- lib/createsend/version.rb
|
187
|
+
- samples/authentication_sample.rb
|
188
|
+
- samples/clients_sample.rb
|
189
|
+
- samples/journey_sample.rb
|
190
|
+
- samples/lists_sample.rb
|
191
|
+
- samples/segments_sample.rb
|
192
|
+
- samples/subscribes_sample.rb
|
186
193
|
- test/administrator_test.rb
|
187
194
|
- test/campaign_test.rb
|
188
195
|
- test/client_test.rb
|
@@ -228,6 +235,13 @@ files:
|
|
228
235
|
- test/fixtures/import_subscribers.json
|
229
236
|
- test/fixtures/import_subscribers_partial_success.json
|
230
237
|
- test/fixtures/invalid_oauth_token_api_error.json
|
238
|
+
- test/fixtures/journey_bounces.json
|
239
|
+
- test/fixtures/journey_clicks.json
|
240
|
+
- test/fixtures/journey_opens.json
|
241
|
+
- test/fixtures/journey_recipients.json
|
242
|
+
- test/fixtures/journey_summary.json
|
243
|
+
- test/fixtures/journey_unsubscribes.json
|
244
|
+
- test/fixtures/journeys.json
|
231
245
|
- test/fixtures/list_details.json
|
232
246
|
- test/fixtures/list_stats.json
|
233
247
|
- test/fixtures/list_webhooks.json
|
@@ -245,9 +259,11 @@ files:
|
|
245
259
|
- test/fixtures/segment_subscribers.json
|
246
260
|
- test/fixtures/segments.json
|
247
261
|
- test/fixtures/subscriber_details.json
|
262
|
+
- test/fixtures/subscriber_details_with_track_pref.json
|
248
263
|
- test/fixtures/subscriber_history.json
|
249
264
|
- test/fixtures/suppressionlist.json
|
250
265
|
- test/fixtures/systemdate.json
|
266
|
+
- test/fixtures/tags.json
|
251
267
|
- test/fixtures/template_details.json
|
252
268
|
- test/fixtures/templates.json
|
253
269
|
- test/fixtures/timezones.json
|
@@ -269,6 +285,7 @@ files:
|
|
269
285
|
- test/fixtures/unsubscribed_subscribers.json
|
270
286
|
- test/fixtures/update_custom_field.json
|
271
287
|
- test/helper.rb
|
288
|
+
- test/journey_test.rb
|
272
289
|
- test/list_test.rb
|
273
290
|
- test/person_test.rb
|
274
291
|
- test/segment_test.rb
|
@@ -281,7 +298,7 @@ homepage: http://campaignmonitor.github.io/createsend-ruby/
|
|
281
298
|
licenses:
|
282
299
|
- MIT
|
283
300
|
metadata: {}
|
284
|
-
post_install_message:
|
301
|
+
post_install_message:
|
285
302
|
rdoc_options: []
|
286
303
|
require_paths:
|
287
304
|
- lib
|
@@ -296,9 +313,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
296
313
|
- !ruby/object:Gem::Version
|
297
314
|
version: 1.3.6
|
298
315
|
requirements: []
|
299
|
-
|
300
|
-
|
301
|
-
signing_key:
|
316
|
+
rubygems_version: 3.3.3
|
317
|
+
signing_key:
|
302
318
|
specification_version: 4
|
303
319
|
summary: A library which implements the complete functionality of the Campaign Monitor
|
304
320
|
API.
|