createsend 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. data/.gitignore +7 -0
  2. data/Gemfile +3 -0
  3. data/README.md +3 -0
  4. data/Rakefile +23 -0
  5. data/config.example.yaml +2 -0
  6. data/createsend.gemspec +26 -0
  7. data/lib/campaign.rb +90 -0
  8. data/lib/client.rb +117 -0
  9. data/lib/createsend.rb +103 -0
  10. data/lib/list.rb +99 -0
  11. data/lib/subscriber.rb +49 -0
  12. data/lib/template.rb +38 -0
  13. data/test/campaign_test.rb +98 -0
  14. data/test/client_test.rb +107 -0
  15. data/test/createsend_test.rb +96 -0
  16. data/test/fixtures/active_subscribers.json +67 -0
  17. data/test/fixtures/add_subscriber.json +1 -0
  18. data/test/fixtures/apikey.json +3 -0
  19. data/test/fixtures/bounced_subscribers.json +9 -0
  20. data/test/fixtures/campaign_bounces.json +16 -0
  21. data/test/fixtures/campaign_clicks.json +23 -0
  22. data/test/fixtures/campaign_lists.json +10 -0
  23. data/test/fixtures/campaign_opens.json +32 -0
  24. data/test/fixtures/campaign_summary.json +9 -0
  25. data/test/fixtures/campaign_unsubscribes.json +9 -0
  26. data/test/fixtures/campaigns.json +18 -0
  27. data/test/fixtures/client_details.json +25 -0
  28. data/test/fixtures/clients.json +10 -0
  29. data/test/fixtures/countries.json +247 -0
  30. data/test/fixtures/create_campaign.json +1 -0
  31. data/test/fixtures/create_client.json +1 -0
  32. data/test/fixtures/create_custom_field.json +1 -0
  33. data/test/fixtures/create_list.json +1 -0
  34. data/test/fixtures/create_template.json +1 -0
  35. data/test/fixtures/custom_api_error.json +4 -0
  36. data/test/fixtures/custom_fields.json +20 -0
  37. data/test/fixtures/drafts.json +14 -0
  38. data/test/fixtures/import_subscribers.json +7 -0
  39. data/test/fixtures/list_details.json +7 -0
  40. data/test/fixtures/list_stats.json +26 -0
  41. data/test/fixtures/lists.json +10 -0
  42. data/test/fixtures/segments.json +10 -0
  43. data/test/fixtures/subscriber_details.json +20 -0
  44. data/test/fixtures/subscriber_history.json +45 -0
  45. data/test/fixtures/suppressionlist.json +12 -0
  46. data/test/fixtures/systemdate.json +3 -0
  47. data/test/fixtures/template_details.json +6 -0
  48. data/test/fixtures/templates.json +14 -0
  49. data/test/fixtures/timezones.json +99 -0
  50. data/test/fixtures/unsubscribed_subscribers.json +21 -0
  51. data/test/helper.rb +36 -0
  52. data/test/list_test.rb +107 -0
  53. data/test/subscriber_test.rb +73 -0
  54. data/test/template_test.rb +38 -0
  55. metadata +256 -0
@@ -0,0 +1 @@
1
+ "subscriber@example.com"
@@ -0,0 +1,3 @@
1
+ {
2
+ "ApiKey": "981298u298ue98u219e8u2e98u2"
3
+ }
@@ -0,0 +1,9 @@
1
+ [
2
+ {
3
+ "EmailAddress": "bouncedsubscriber@example.com",
4
+ "Name": "Bounced One",
5
+ "Date": "2010-10-25 13:11:00",
6
+ "State": "Bounced",
7
+ "CustomFields": []
8
+ }
9
+ ]
@@ -0,0 +1,16 @@
1
+ [
2
+ {
3
+ "EmailAddress": "asdf@softbouncemyemail.com",
4
+ "ListID": "654523a5855b4a440bae3fb295641546",
5
+ "BounceType": "Soft",
6
+ "Date": "2010-07-02 16:46:00",
7
+ "Reason": "Bounce - But No Email Address Returned "
8
+ },
9
+ {
10
+ "EmailAddress": "asdf@hardbouncemyemail.com",
11
+ "ListID": "654523a5855b4a440bae3fb295641546",
12
+ "BounceType": "Soft",
13
+ "Date": "2010-07-02 16:46:00",
14
+ "Reason": "Soft Bounce - General"
15
+ }
16
+ ]
@@ -0,0 +1,23 @@
1
+ [
2
+ {
3
+ "EmailAddress": "subs+6576576576@example.com",
4
+ "URL": "http://video.google.com.au/?hl=en&tab=wv",
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
+ "URL": "http://mail.google.com/mail/?hl=en&tab=wm",
12
+ "ListID": "512a3bc577a58fdf689c654329b50fa0",
13
+ "Date": "2010-10-11 08:29:00",
14
+ "IPAddress": "192.168.126.87"
15
+ },
16
+ {
17
+ "EmailAddress": "subs+6576576576@example.com",
18
+ "URL": "http://mail.google.com/mail/?hl=en&tab=wm",
19
+ "ListID": "512a3bc577a58fdf689c654329b50fa0",
20
+ "Date": "2010-10-06 17:24:00",
21
+ "IPAddress": "192.168.126.87"
22
+ }
23
+ ]
@@ -0,0 +1,10 @@
1
+ [
2
+ {
3
+ "ListID": "a58ee1d3039b8bec838e6d1482a8a965",
4
+ "Name": "List One"
5
+ },
6
+ {
7
+ "ListID": "99bc35084a5739127a8ab81eae5bd305",
8
+ "Name": "List Two"
9
+ }
10
+ ]
@@ -0,0 +1,32 @@
1
+ [
2
+ {
3
+ "EmailAddress": "subs+6576576576@example.com",
4
+ "ListID": "512a3bc577a58fdf689c654329b50fa0",
5
+ "Date": "2010-10-11 08:29:00",
6
+ "IPAddress": "192.168.126.87"
7
+ },
8
+ {
9
+ "EmailAddress": "subs+6576576576@example.com",
10
+ "ListID": "512a3bc577a58fdf689c654329b50fa0",
11
+ "Date": "2010-10-08 14:24:00",
12
+ "IPAddress": "192.168.126.87"
13
+ },
14
+ {
15
+ "EmailAddress": "subs+6576576576@example.com",
16
+ "ListID": "512a3bc577a58fdf689c654329b50fa0",
17
+ "Date": "2010-10-07 10:20:00",
18
+ "IPAddress": "192.168.126.87"
19
+ },
20
+ {
21
+ "EmailAddress": "subs+6576576576@example.com",
22
+ "ListID": "512a3bc577a58fdf689c654329b50fa0",
23
+ "Date": "2010-10-07 07:15:00",
24
+ "IPAddress": "192.168.126.87"
25
+ },
26
+ {
27
+ "EmailAddress": "subs+6576576576@example.com",
28
+ "ListID": "512a3bc577a58fdf689c654329b50fa0",
29
+ "Date": "2010-10-07 06:58:00",
30
+ "IPAddress": "192.168.126.87"
31
+ }
32
+ ]
@@ -0,0 +1,9 @@
1
+ {
2
+ "Recipients": 5,
3
+ "TotalOpened": 10,
4
+ "Clicks": 0,
5
+ "Unsubscribed": 0,
6
+ "Bounced": 0,
7
+ "UniqueOpened": 5,
8
+ "WebVersionURL": "http://clientone.createsend.com//t/ViewEmail/r/3A433FC72FFE3B8B/C67FD2F38AC4859C/"
9
+ }
@@ -0,0 +1,9 @@
1
+ [
2
+ {
3
+ "EmailAddress": "subs+6576576576@example.com",
4
+ "URL": "http://video.google.com.au/?hl=en&tab=wv",
5
+ "ListID": "512a3bc577a58fdf689c654329b50fa0",
6
+ "Date": "2010-10-11 08:29:00",
7
+ "IPAddress": "192.168.126.87"
8
+ }
9
+ ]
@@ -0,0 +1,18 @@
1
+ [
2
+ {
3
+ "WebVersionURL": "http://hello.createsend.com//t/ViewEmail/r/765E86829575EE2C/C67FD2F38AC4859C/",
4
+ "CampaignID": "fc0ce7105baeaf97f47c99be31d02a91",
5
+ "Subject": "Campaign One",
6
+ "Name": "Campaign One",
7
+ "SentDate": "2010-10-12 12:58:00",
8
+ "TotalRecipients": 2245
9
+ },
10
+ {
11
+ "WebVersionURL": "http://hello.createsend.com//t/ViewEmail/r/DD543566A87C9B8B/C67FD2F38AC4859C/",
12
+ "CampaignID": "072472b88c853ae5dedaeaf549a8d607",
13
+ "Subject": "Campaign Two",
14
+ "Name": "Campaign Two",
15
+ "SentDate": "2010-10-06 16:20:00",
16
+ "TotalRecipients": 11222
17
+ }
18
+ ]
@@ -0,0 +1,25 @@
1
+ {
2
+ "AccessDetails": {
3
+ "Username": "clientone",
4
+ "AccessLevel": 23
5
+ },
6
+ "BasicDetails": {
7
+ "ClientID": "4a397ccaaa55eb4e6aa1221e1e2d7122",
8
+ "CompanyName": "Client One",
9
+ "ContactName": "Client One (contact)",
10
+ "EmailAddress": "contact@example.com",
11
+ "Country": "Australia",
12
+ "Timezone": "(GMT+10:00) Canberra, Melbourne, Sydney"
13
+ },
14
+ "BillingDetails": {
15
+ "CanPurchaseCredits": true,
16
+ "MarkupOnDesignSpamTest": 0.0,
17
+ "ClientPays": true,
18
+ "BaseRatePerRecipient": 1.0,
19
+ "MarkupPerRecipient": 0.0,
20
+ "MarkupOnDelivery": 0.0,
21
+ "BaseDeliveryRate": 5.0,
22
+ "Currency": "USD",
23
+ "BaseDesignSpamTestRate": 5.0
24
+ }
25
+ }
@@ -0,0 +1,10 @@
1
+ [
2
+ {
3
+ "ClientID": "4a397ccaaa55eb4e6aa1221e1e2d7122",
4
+ "Name": "Client One"
5
+ },
6
+ {
7
+ "ClientID": "a206def0582eec7dae47d937a4109cb2",
8
+ "Name": "Client Two"
9
+ }
10
+ ]
@@ -0,0 +1,247 @@
1
+ [
2
+ "Afghanistan",
3
+ "Albania",
4
+ "Algeria",
5
+ "American Samoa",
6
+ "Andorra",
7
+ "Angola",
8
+ "Anguilla",
9
+ "Antigua & Barbuda",
10
+ "Argentina",
11
+ "Armenia",
12
+ "Aruba",
13
+ "Australia",
14
+ "Austria",
15
+ "Azerbaijan",
16
+ "Azores",
17
+ "Bahamas",
18
+ "Bahrain",
19
+ "Bangladesh",
20
+ "Barbados",
21
+ "Belarus",
22
+ "Belgium",
23
+ "Belize",
24
+ "Benin",
25
+ "Bermuda",
26
+ "Bhutan",
27
+ "Bolivia",
28
+ "Bonaire",
29
+ "Bosnia & Herzegovina",
30
+ "Botswana",
31
+ "Brazil",
32
+ "British Indian Ocean Ter",
33
+ "Brunei",
34
+ "Bulgaria",
35
+ "Burkina Faso",
36
+ "Burundi",
37
+ "Cambodia",
38
+ "Cameroon",
39
+ "Canada",
40
+ "Canary Islands",
41
+ "Cape Verde",
42
+ "Cayman Islands",
43
+ "Central African Republic",
44
+ "Chad",
45
+ "Channel Islands",
46
+ "Chile",
47
+ "China",
48
+ "Christmas Island",
49
+ "Cocos Island",
50
+ "Columbia",
51
+ "Comoros",
52
+ "Congo",
53
+ "Congo Democratic Rep",
54
+ "Cook Islands",
55
+ "Costa Rica",
56
+ "Cote D'Ivoire",
57
+ "Croatia",
58
+ "Cuba",
59
+ "Curacao",
60
+ "Cyprus",
61
+ "Czech Republic",
62
+ "Denmark",
63
+ "Djibouti",
64
+ "Dominica",
65
+ "Dominican Republic",
66
+ "East Timor",
67
+ "Ecuador",
68
+ "Egypt",
69
+ "El Salvador",
70
+ "Equatorial Guinea",
71
+ "Eritrea",
72
+ "Estonia",
73
+ "Ethiopia",
74
+ "Falkland Islands",
75
+ "Faroe Islands",
76
+ "Fiji",
77
+ "Finland",
78
+ "France",
79
+ "French Guiana",
80
+ "French Polynesia",
81
+ "French Southern Ter",
82
+ "Gabon",
83
+ "Gambia",
84
+ "Georgia",
85
+ "Germany",
86
+ "Ghana",
87
+ "Gibraltar",
88
+ "Great Britain",
89
+ "Greece",
90
+ "Greenland",
91
+ "Grenada",
92
+ "Guadeloupe",
93
+ "Guam",
94
+ "Guatemala",
95
+ "Guinea",
96
+ "Guyana",
97
+ "Haiti",
98
+ "Honduras",
99
+ "Hong Kong",
100
+ "Hungary",
101
+ "Iceland",
102
+ "India",
103
+ "Indonesia",
104
+ "Iran",
105
+ "Iraq",
106
+ "Ireland",
107
+ "Isle of Man",
108
+ "Israel",
109
+ "Italy",
110
+ "Jamaica",
111
+ "Japan",
112
+ "Jordan",
113
+ "Kazakhstan",
114
+ "Kenya",
115
+ "Kiribati",
116
+ "Korea North",
117
+ "Korea South",
118
+ "Kuwait",
119
+ "Kyrgyzstan",
120
+ "Laos",
121
+ "Latvia",
122
+ "Lebanon",
123
+ "Lesotho",
124
+ "Liberia",
125
+ "Libya",
126
+ "Liechtenstein",
127
+ "Lithuania",
128
+ "Luxembourg",
129
+ "Macau",
130
+ "Macedonia",
131
+ "Madagascar",
132
+ "Malawi",
133
+ "Malaysia",
134
+ "Maldives",
135
+ "Mali",
136
+ "Malta",
137
+ "Marshall Islands",
138
+ "Martinique",
139
+ "Mauritania",
140
+ "Mauritius",
141
+ "Mayotte",
142
+ "Mexico",
143
+ "Midway Islands",
144
+ "Moldova",
145
+ "Monaco",
146
+ "Mongolia",
147
+ "Montserrat",
148
+ "Morocco",
149
+ "Mozambique",
150
+ "Myanmar",
151
+ "Namibia",
152
+ "Nauru",
153
+ "Nepal",
154
+ "Netherland Antilles",
155
+ "Netherlands",
156
+ "Nevis",
157
+ "New Caledonia",
158
+ "New Zealand",
159
+ "Nicaragua",
160
+ "Niger",
161
+ "Nigeria",
162
+ "Niue",
163
+ "Norfolk Island",
164
+ "Norway",
165
+ "Oman",
166
+ "Pakistan",
167
+ "Palau Island",
168
+ "Palestine",
169
+ "Panama",
170
+ "Papua New Guinea",
171
+ "Paraguay",
172
+ "Peru",
173
+ "Philippines",
174
+ "Pitcairn Island",
175
+ "Poland",
176
+ "Portugal",
177
+ "Puerto Rico",
178
+ "Qatar",
179
+ "Reunion",
180
+ "Romania",
181
+ "Russia",
182
+ "Rwanda",
183
+ "Saipan",
184
+ "Samoa",
185
+ "Samoa American",
186
+ "San Marino",
187
+ "Sao Tome & Principe",
188
+ "Saudi Arabia",
189
+ "Senegal",
190
+ "Serbia & Montenegro",
191
+ "Seychelles",
192
+ "Sierra Leone",
193
+ "Singapore",
194
+ "Slovakia",
195
+ "Slovenia",
196
+ "Solomon Islands",
197
+ "Somalia",
198
+ "South Africa",
199
+ "Spain",
200
+ "Sri Lanka",
201
+ "St Barthelemy",
202
+ "St Eustatius",
203
+ "St Helena",
204
+ "St Kitts-Nevis",
205
+ "St Lucia",
206
+ "St Maarten",
207
+ "St Pierre & Miquelon",
208
+ "St Vincent & Grenadines",
209
+ "Sudan",
210
+ "Suriname",
211
+ "Swaziland",
212
+ "Sweden",
213
+ "Switzerland",
214
+ "Syria",
215
+ "Tahiti",
216
+ "Taiwan",
217
+ "Tajikistan",
218
+ "Tanzania",
219
+ "Thailand",
220
+ "Togo",
221
+ "Tokelau",
222
+ "Tonga",
223
+ "Trinidad & Tobago",
224
+ "Tunisia",
225
+ "Turkey",
226
+ "Turkmenistan",
227
+ "Turks & Caicos Is",
228
+ "Tuvalu",
229
+ "Uganda",
230
+ "Ukraine",
231
+ "United Arab Emirates",
232
+ "United Kingdom",
233
+ "United States of America",
234
+ "Uruguay",
235
+ "Uzbekistan",
236
+ "Vanuatu",
237
+ "Vatican City State",
238
+ "Venezuela",
239
+ "Vietnam",
240
+ "Virgin Islands (Brit)",
241
+ "Virgin Islands (USA)",
242
+ "Wake Island",
243
+ "Wallis & Futana Is",
244
+ "Yemen",
245
+ "Zambia",
246
+ "Zimbabwe"
247
+ ]
@@ -0,0 +1 @@
1
+ "787y87y87y87y87y87y87"
@@ -0,0 +1 @@
1
+ "32a381c49a2df99f1d0c6f3c112352b9"
@@ -0,0 +1 @@
1
+ "[newdatefield]"
@@ -0,0 +1 @@
1
+ "e3c5f034d68744f7881fdccf13c2daee"