createsend 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +19 -0
- data/README.md +63 -1
- data/createsend.gemspec +2 -2
- data/lib/campaign.rb +73 -29
- data/lib/client.rb +23 -4
- data/lib/createsend.rb +18 -7
- data/lib/list.rb +55 -13
- data/lib/segment.rb +83 -0
- data/lib/subscriber.rb +19 -1
- data/lib/template.rb +5 -0
- data/test/campaign_test.rb +88 -39
- data/test/client_test.rb +19 -9
- data/test/fixtures/active_subscribers.json +69 -67
- data/test/fixtures/bounced_subscribers.json +18 -9
- data/test/fixtures/campaign_bounces.json +25 -16
- data/test/fixtures/campaign_clicks.json +32 -23
- data/test/fixtures/campaign_listsandsegments.json +15 -0
- data/test/fixtures/campaign_opens.json +41 -32
- data/test/fixtures/campaign_recipients.json +91 -0
- data/test/fixtures/campaign_summary.json +1 -1
- data/test/fixtures/campaign_unsubscribes.json +18 -9
- data/test/fixtures/campaigns.json +2 -2
- data/test/fixtures/client_details.json +2 -1
- data/test/fixtures/create_segment.json +1 -0
- data/test/fixtures/drafts.json +4 -2
- data/test/fixtures/import_subscribers_partial_success.json +17 -0
- data/test/fixtures/segment_details.json +20 -0
- data/test/fixtures/segment_subscribers.json +25 -0
- data/test/fixtures/segments.json +4 -2
- data/test/fixtures/suppressionlist.json +36 -12
- data/test/fixtures/unsubscribed_subscribers.json +51 -21
- data/test/list_test.rb +64 -24
- data/test/segment_test.rb +75 -0
- data/test/subscriber_test.rb +19 -0
- metadata +22 -8
- data/test/fixtures/campaign_lists.json +0 -10
@@ -1,9 +1,18 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
1
|
+
{
|
2
|
+
"Results": [
|
3
|
+
{
|
4
|
+
"EmailAddress": "bouncedsubscriber@example.com",
|
5
|
+
"Name": "Bounced One",
|
6
|
+
"Date": "2010-10-25 13:11:00",
|
7
|
+
"State": "Bounced",
|
8
|
+
"CustomFields": []
|
9
|
+
}
|
10
|
+
],
|
11
|
+
"ResultsOrderedBy": "email",
|
12
|
+
"OrderDirection": "asc",
|
13
|
+
"PageNumber": 1,
|
14
|
+
"PageSize": 1000,
|
15
|
+
"RecordsOnThisPage": 1,
|
16
|
+
"TotalNumberOfRecords": 1,
|
17
|
+
"NumberOfPages": 1
|
18
|
+
}
|
@@ -1,16 +1,25 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
1
|
+
{
|
2
|
+
"Results": [
|
3
|
+
{
|
4
|
+
"EmailAddress": "asdf@softbouncemyemail.com",
|
5
|
+
"ListID": "654523a5855b4a440bae3fb295641546",
|
6
|
+
"BounceType": "Soft",
|
7
|
+
"Date": "2010-07-02 16:46:00",
|
8
|
+
"Reason": "Bounce - But No Email Address Returned "
|
9
|
+
},
|
10
|
+
{
|
11
|
+
"EmailAddress": "asdf@hardbouncemyemail.com",
|
12
|
+
"ListID": "654523a5855b4a440bae3fb295641546",
|
13
|
+
"BounceType": "Soft",
|
14
|
+
"Date": "2010-07-02 16:46:00",
|
15
|
+
"Reason": "Soft Bounce - General"
|
16
|
+
}
|
17
|
+
],
|
18
|
+
"ResultsOrderedBy": "date",
|
19
|
+
"OrderDirection": "asc",
|
20
|
+
"PageNumber": 1,
|
21
|
+
"PageSize": 1000,
|
22
|
+
"RecordsOnThisPage": 2,
|
23
|
+
"TotalNumberOfRecords": 2,
|
24
|
+
"NumberOfPages": 1
|
25
|
+
}
|
@@ -1,23 +1,32 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
1
|
+
{
|
2
|
+
"Results": [
|
3
|
+
{
|
4
|
+
"EmailAddress": "subs+6576576576@example.com",
|
5
|
+
"URL": "http://video.google.com.au/?hl=en&tab=wv",
|
6
|
+
"ListID": "512a3bc577a58fdf689c654329b50fa0",
|
7
|
+
"Date": "2010-10-11 08:29:00",
|
8
|
+
"IPAddress": "192.168.126.87"
|
9
|
+
},
|
10
|
+
{
|
11
|
+
"EmailAddress": "subs+6576576576@example.com",
|
12
|
+
"URL": "http://mail.google.com/mail/?hl=en&tab=wm",
|
13
|
+
"ListID": "512a3bc577a58fdf689c654329b50fa0",
|
14
|
+
"Date": "2010-10-11 08:29:00",
|
15
|
+
"IPAddress": "192.168.126.87"
|
16
|
+
},
|
17
|
+
{
|
18
|
+
"EmailAddress": "subs+6576576576@example.com",
|
19
|
+
"URL": "http://mail.google.com/mail/?hl=en&tab=wm",
|
20
|
+
"ListID": "512a3bc577a58fdf689c654329b50fa0",
|
21
|
+
"Date": "2010-10-06 17:24:00",
|
22
|
+
"IPAddress": "192.168.126.87"
|
23
|
+
}
|
24
|
+
],
|
25
|
+
"ResultsOrderedBy": "date",
|
26
|
+
"OrderDirection": "asc",
|
27
|
+
"PageNumber": 1,
|
28
|
+
"PageSize": 1000,
|
29
|
+
"RecordsOnThisPage": 3,
|
30
|
+
"TotalNumberOfRecords": 3,
|
31
|
+
"NumberOfPages": 1
|
32
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
{
|
2
|
+
"Lists": [
|
3
|
+
{
|
4
|
+
"ListID": "a58ee1d3039b8bec838e6d1482a8a965",
|
5
|
+
"Name": "List One"
|
6
|
+
}
|
7
|
+
],
|
8
|
+
"Segments": [
|
9
|
+
{
|
10
|
+
"ListID": "2bea949d0bf96148c3e6a209d2e82060",
|
11
|
+
"SegmentID": "dba84a225d5ce3d19105d7257baac46f",
|
12
|
+
"Title": "Segment for campaign"
|
13
|
+
}
|
14
|
+
]
|
15
|
+
}
|
@@ -1,32 +1,41 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
1
|
+
{
|
2
|
+
"Results": [
|
3
|
+
{
|
4
|
+
"EmailAddress": "subs+6576576576@example.com",
|
5
|
+
"ListID": "512a3bc577a58fdf689c654329b50fa0",
|
6
|
+
"Date": "2010-10-11 08:29:00",
|
7
|
+
"IPAddress": "192.168.126.87"
|
8
|
+
},
|
9
|
+
{
|
10
|
+
"EmailAddress": "subs+6576576576@example.com",
|
11
|
+
"ListID": "512a3bc577a58fdf689c654329b50fa0",
|
12
|
+
"Date": "2010-10-08 14:24:00",
|
13
|
+
"IPAddress": "192.168.126.87"
|
14
|
+
},
|
15
|
+
{
|
16
|
+
"EmailAddress": "subs+6576576576@example.com",
|
17
|
+
"ListID": "512a3bc577a58fdf689c654329b50fa0",
|
18
|
+
"Date": "2010-10-07 10:20:00",
|
19
|
+
"IPAddress": "192.168.126.87"
|
20
|
+
},
|
21
|
+
{
|
22
|
+
"EmailAddress": "subs+6576576576@example.com",
|
23
|
+
"ListID": "512a3bc577a58fdf689c654329b50fa0",
|
24
|
+
"Date": "2010-10-07 07:15:00",
|
25
|
+
"IPAddress": "192.168.126.87"
|
26
|
+
},
|
27
|
+
{
|
28
|
+
"EmailAddress": "subs+6576576576@example.com",
|
29
|
+
"ListID": "512a3bc577a58fdf689c654329b50fa0",
|
30
|
+
"Date": "2010-10-07 06:58:00",
|
31
|
+
"IPAddress": "192.168.126.87"
|
32
|
+
}
|
33
|
+
],
|
34
|
+
"ResultsOrderedBy": "date",
|
35
|
+
"OrderDirection": "asc",
|
36
|
+
"PageNumber": 1,
|
37
|
+
"PageSize": 1000,
|
38
|
+
"RecordsOnThisPage": 5,
|
39
|
+
"TotalNumberOfRecords": 5,
|
40
|
+
"NumberOfPages": 1
|
41
|
+
}
|
@@ -0,0 +1,91 @@
|
|
1
|
+
{
|
2
|
+
"Results": [
|
3
|
+
{
|
4
|
+
"EmailAddress": "subs+6g76t7t0@example.com",
|
5
|
+
"ListID": "a994a3caf1328a16af9a69a730eaa706"
|
6
|
+
},
|
7
|
+
{
|
8
|
+
"EmailAddress": "subs+6g76t7t1@example.com",
|
9
|
+
"ListID": "a994a3caf1328a16af9a69a730eaa706"
|
10
|
+
},
|
11
|
+
{
|
12
|
+
"EmailAddress": "subs+6g76t7t10@example.com",
|
13
|
+
"ListID": "a994a3caf1328a16af9a69a730eaa706"
|
14
|
+
},
|
15
|
+
{
|
16
|
+
"EmailAddress": "subs+6g76t7t100@example.com",
|
17
|
+
"ListID": "a994a3caf1328a16af9a69a730eaa706"
|
18
|
+
},
|
19
|
+
{
|
20
|
+
"EmailAddress": "subs+6g76t7t1000@example.com",
|
21
|
+
"ListID": "a994a3caf1328a16af9a69a730eaa706"
|
22
|
+
},
|
23
|
+
{
|
24
|
+
"EmailAddress": "subs+6g76t7t1001@example.com",
|
25
|
+
"ListID": "a994a3caf1328a16af9a69a730eaa706"
|
26
|
+
},
|
27
|
+
{
|
28
|
+
"EmailAddress": "subs+6g76t7t1002@example.com",
|
29
|
+
"ListID": "a994a3caf1328a16af9a69a730eaa706"
|
30
|
+
},
|
31
|
+
{
|
32
|
+
"EmailAddress": "subs+6g76t7t1003@example.com",
|
33
|
+
"ListID": "a994a3caf1328a16af9a69a730eaa706"
|
34
|
+
},
|
35
|
+
{
|
36
|
+
"EmailAddress": "subs+6g76t7t1004@example.com",
|
37
|
+
"ListID": "a994a3caf1328a16af9a69a730eaa706"
|
38
|
+
},
|
39
|
+
{
|
40
|
+
"EmailAddress": "subs+6g76t7t1005@example.com",
|
41
|
+
"ListID": "a994a3caf1328a16af9a69a730eaa706"
|
42
|
+
},
|
43
|
+
{
|
44
|
+
"EmailAddress": "subs+6g76t7t1006@example.com",
|
45
|
+
"ListID": "a994a3caf1328a16af9a69a730eaa706"
|
46
|
+
},
|
47
|
+
{
|
48
|
+
"EmailAddress": "subs+6g76t7t1007@example.com",
|
49
|
+
"ListID": "a994a3caf1328a16af9a69a730eaa706"
|
50
|
+
},
|
51
|
+
{
|
52
|
+
"EmailAddress": "subs+6g76t7t1008@example.com",
|
53
|
+
"ListID": "a994a3caf1328a16af9a69a730eaa706"
|
54
|
+
},
|
55
|
+
{
|
56
|
+
"EmailAddress": "subs+6g76t7t1009@example.com",
|
57
|
+
"ListID": "a994a3caf1328a16af9a69a730eaa706"
|
58
|
+
},
|
59
|
+
{
|
60
|
+
"EmailAddress": "subs+6g76t7t101@example.com",
|
61
|
+
"ListID": "a994a3caf1328a16af9a69a730eaa706"
|
62
|
+
},
|
63
|
+
{
|
64
|
+
"EmailAddress": "subs+6g76t7t1010@example.com",
|
65
|
+
"ListID": "a994a3caf1328a16af9a69a730eaa706"
|
66
|
+
},
|
67
|
+
{
|
68
|
+
"EmailAddress": "subs+6g76t7t1011@example.com",
|
69
|
+
"ListID": "a994a3caf1328a16af9a69a730eaa706"
|
70
|
+
},
|
71
|
+
{
|
72
|
+
"EmailAddress": "subs+6g76t7t1012@example.com",
|
73
|
+
"ListID": "a994a3caf1328a16af9a69a730eaa706"
|
74
|
+
},
|
75
|
+
{
|
76
|
+
"EmailAddress": "subs+6g76t7t1013@example.com",
|
77
|
+
"ListID": "a994a3caf1328a16af9a69a730eaa706"
|
78
|
+
},
|
79
|
+
{
|
80
|
+
"EmailAddress": "subs+6g76t7t1014@example.com",
|
81
|
+
"ListID": "a994a3caf1328a16af9a69a730eaa706"
|
82
|
+
}
|
83
|
+
],
|
84
|
+
"ResultsOrderedBy": "email",
|
85
|
+
"OrderDirection": "asc",
|
86
|
+
"PageNumber": 1,
|
87
|
+
"PageSize": 20,
|
88
|
+
"RecordsOnThisPage": 20,
|
89
|
+
"TotalNumberOfRecords": 2200,
|
90
|
+
"NumberOfPages": 110
|
91
|
+
}
|
@@ -1,9 +1,18 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
1
|
+
{
|
2
|
+
"Results": [
|
3
|
+
{
|
4
|
+
"EmailAddress": "subs+6576576576@example.com",
|
5
|
+
"URL": "http://video.google.com.au/?hl=en&tab=wv",
|
6
|
+
"ListID": "512a3bc577a58fdf689c654329b50fa0",
|
7
|
+
"Date": "2010-10-11 08:29:00",
|
8
|
+
"IPAddress": "192.168.126.87"
|
9
|
+
}
|
10
|
+
],
|
11
|
+
"ResultsOrderedBy": "date",
|
12
|
+
"OrderDirection": "asc",
|
13
|
+
"PageNumber": 1,
|
14
|
+
"PageSize": 1000,
|
15
|
+
"RecordsOnThisPage": 1,
|
16
|
+
"TotalNumberOfRecords": 1,
|
17
|
+
"NumberOfPages": 1
|
18
|
+
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
[
|
2
2
|
{
|
3
|
-
"WebVersionURL": "http://hello.createsend.com
|
3
|
+
"WebVersionURL": "http://hello.createsend.com/t/ViewEmail/r/765E86829575EE2C/C67FD2F38AC4859C/",
|
4
4
|
"CampaignID": "fc0ce7105baeaf97f47c99be31d02a91",
|
5
5
|
"Subject": "Campaign One",
|
6
6
|
"Name": "Campaign One",
|
@@ -8,7 +8,7 @@
|
|
8
8
|
"TotalRecipients": 2245
|
9
9
|
},
|
10
10
|
{
|
11
|
-
"WebVersionURL": "http://hello.createsend.com
|
11
|
+
"WebVersionURL": "http://hello.createsend.com/t/ViewEmail/r/DD543566A87C9B8B/C67FD2F38AC4859C/",
|
12
12
|
"CampaignID": "072472b88c853ae5dedaeaf549a8d607",
|
13
13
|
"Subject": "Campaign Two",
|
14
14
|
"Name": "Campaign Two",
|
@@ -1,4 +1,5 @@
|
|
1
1
|
{
|
2
|
+
"ApiKey": "639d8cc27198202f5fe6037a8b17a29a59984b86d3289bc9",
|
2
3
|
"AccessDetails": {
|
3
4
|
"Username": "clientone",
|
4
5
|
"AccessLevel": 23
|
@@ -9,7 +10,7 @@
|
|
9
10
|
"ContactName": "Client One (contact)",
|
10
11
|
"EmailAddress": "contact@example.com",
|
11
12
|
"Country": "Australia",
|
12
|
-
"
|
13
|
+
"TimeZone": "(GMT+10:00) Canberra, Melbourne, Sydney"
|
13
14
|
},
|
14
15
|
"BillingDetails": {
|
15
16
|
"CanPurchaseCredits": true,
|
@@ -0,0 +1 @@
|
|
1
|
+
"0246c2aea610a3545d9780bf6ab89006"
|
data/test/fixtures/drafts.json
CHANGED
@@ -3,12 +3,14 @@
|
|
3
3
|
"CampaignID": "7c7424792065d92627139208c8c01db1",
|
4
4
|
"Name": "Draft One",
|
5
5
|
"Subject": "Draft One",
|
6
|
-
"DateCreated": "2010-08-19 16:08:00"
|
6
|
+
"DateCreated": "2010-08-19 16:08:00",
|
7
|
+
"PreviewURL": "http://hello.createsend.com/t/ViewEmail/r/E97A7BB2E6983DA1/C67FD2F38AC4859C/"
|
7
8
|
},
|
8
9
|
{
|
9
10
|
"CampaignID": "2e928e982065d92627139208c8c01db1",
|
10
11
|
"Name": "Draft Two",
|
11
12
|
"Subject": "Draft Two",
|
12
|
-
"DateCreated": "2010-08-19 16:08:00"
|
13
|
+
"DateCreated": "2010-08-19 16:08:00",
|
14
|
+
"PreviewURL": "http://hello.createsend.com/t/ViewEmail/r/E97A7BB2E6983DA1/C67FD2F38AC4859C/"
|
13
15
|
}
|
14
16
|
]
|
@@ -0,0 +1,17 @@
|
|
1
|
+
{
|
2
|
+
"ResultData": {
|
3
|
+
"TotalUniqueEmailsSubmitted": 3,
|
4
|
+
"TotalExistingSubscribers": 2,
|
5
|
+
"TotalNewSubscribers": 0,
|
6
|
+
"DuplicateEmailsInSubmission": [],
|
7
|
+
"FailureDetails": [
|
8
|
+
{
|
9
|
+
"EmailAddress": "example+1@example",
|
10
|
+
"Code": 1,
|
11
|
+
"Message": "Invalid Email Address"
|
12
|
+
}
|
13
|
+
]
|
14
|
+
},
|
15
|
+
"Code": 210,
|
16
|
+
"Message": "Subscriber Import had some failures"
|
17
|
+
}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
{
|
2
|
+
"ActiveSubscribers": 0,
|
3
|
+
"Rules": [
|
4
|
+
{
|
5
|
+
"Subject": "EmailAddress",
|
6
|
+
"Clauses": [
|
7
|
+
"CONTAINS @hello.com"
|
8
|
+
]
|
9
|
+
},
|
10
|
+
{
|
11
|
+
"Subject": "Name",
|
12
|
+
"Clauses": [
|
13
|
+
"PROVIDED"
|
14
|
+
]
|
15
|
+
}
|
16
|
+
],
|
17
|
+
"ListID": "2bea949d0bf96148c3e6a209d2e82060",
|
18
|
+
"SegmentID": "dba84a225d5ce3d19105d7257baac46f",
|
19
|
+
"Title": "My Segment"
|
20
|
+
}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
{
|
2
|
+
"Results": [
|
3
|
+
{
|
4
|
+
"EmailAddress": "personone@example.com",
|
5
|
+
"Name": "Person One",
|
6
|
+
"Date": "2010-10-27 13:13:00",
|
7
|
+
"State": "Active",
|
8
|
+
"CustomFields": []
|
9
|
+
},
|
10
|
+
{
|
11
|
+
"EmailAddress": "persontwo@example.com",
|
12
|
+
"Name": "Person Two",
|
13
|
+
"Date": "2010-10-27 13:13:00",
|
14
|
+
"State": "Active",
|
15
|
+
"CustomFields": []
|
16
|
+
}
|
17
|
+
],
|
18
|
+
"ResultsOrderedBy": "email",
|
19
|
+
"OrderDirection": "asc",
|
20
|
+
"PageNumber": 1,
|
21
|
+
"PageSize": 1000,
|
22
|
+
"RecordsOnThisPage": 2,
|
23
|
+
"TotalNumberOfRecords": 2,
|
24
|
+
"NumberOfPages": 1
|
25
|
+
}
|