createsend-sendowlfork 6.1.0.pre.hashie5
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 +7 -0
- data/.coveralls.yml +1 -0
- data/.gitignore +9 -0
- data/.travis.yml +7 -0
- data/CONTRIBUTING.md +8 -0
- data/Gemfile +3 -0
- data/HISTORY.md +299 -0
- data/LICENSE +19 -0
- data/README.md +220 -0
- data/RELEASE.md +53 -0
- data/Rakefile +24 -0
- data/createsend.gemspec +31 -0
- data/lib/createsend/administrator.rb +49 -0
- data/lib/createsend/cacert.pem +3849 -0
- data/lib/createsend/campaign.rb +202 -0
- data/lib/createsend/client.rb +224 -0
- data/lib/createsend/createsend.rb +291 -0
- data/lib/createsend/journey.rb +58 -0
- data/lib/createsend/list.rb +258 -0
- data/lib/createsend/person.rb +59 -0
- data/lib/createsend/segment.rb +81 -0
- data/lib/createsend/subscriber.rb +113 -0
- data/lib/createsend/template.rb +42 -0
- data/lib/createsend/transactional_classic_email.rb +32 -0
- data/lib/createsend/transactional_smart_email.rb +31 -0
- data/lib/createsend/transactional_timeline.rb +45 -0
- data/lib/createsend/version.rb +3 -0
- data/lib/createsend.rb +17 -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 +51 -0
- data/samples/segments_sample.rb +21 -0
- data/samples/subscribers_sample.rb +51 -0
- data/test/administrator_test.rb +37 -0
- data/test/campaign_test.rb +296 -0
- data/test/client_test.rb +253 -0
- data/test/createsend_test.rb +321 -0
- data/test/fixtures/active_subscribers.json +87 -0
- data/test/fixtures/add_admin.json +3 -0
- data/test/fixtures/add_person.json +3 -0
- data/test/fixtures/add_subscriber.json +1 -0
- data/test/fixtures/admin_details.json +5 -0
- data/test/fixtures/admin_get_primary_contact.json +3 -0
- data/test/fixtures/admin_set_primary_contact.json +3 -0
- data/test/fixtures/administrators.json +12 -0
- data/test/fixtures/billingdetails.json +3 -0
- data/test/fixtures/bounced_subscribers.json +20 -0
- data/test/fixtures/campaign_bounces.json +25 -0
- data/test/fixtures/campaign_clicks.json +50 -0
- data/test/fixtures/campaign_listsandsegments.json +15 -0
- data/test/fixtures/campaign_opens.json +71 -0
- data/test/fixtures/campaign_recipients.json +91 -0
- data/test/fixtures/campaign_spam.json +16 -0
- data/test/fixtures/campaign_summary.json +16 -0
- data/test/fixtures/campaign_unsubscribes.json +17 -0
- data/test/fixtures/campaigns.json +37 -0
- data/test/fixtures/client_details.json +28 -0
- data/test/fixtures/client_get_primary_contact.json +3 -0
- data/test/fixtures/client_set_primary_contact.json +3 -0
- data/test/fixtures/clients.json +10 -0
- data/test/fixtures/countries.json +247 -0
- data/test/fixtures/create_campaign.json +1 -0
- data/test/fixtures/create_client.json +1 -0
- data/test/fixtures/create_custom_field.json +1 -0
- data/test/fixtures/create_list.json +1 -0
- data/test/fixtures/create_list_webhook.json +1 -0
- data/test/fixtures/create_segment.json +1 -0
- data/test/fixtures/create_template.json +1 -0
- data/test/fixtures/custom_api_error.json +4 -0
- data/test/fixtures/custom_fields.json +23 -0
- data/test/fixtures/deleted_subscribers.json +61 -0
- data/test/fixtures/drafts.json +26 -0
- data/test/fixtures/email_client_usage.json +38 -0
- data/test/fixtures/expired_oauth_token_api_error.json +4 -0
- data/test/fixtures/external_session.json +3 -0
- data/test/fixtures/import_subscribers.json +7 -0
- data/test/fixtures/import_subscribers_partial_success.json +17 -0
- data/test/fixtures/invalid_oauth_token_api_error.json +4 -0
- 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/list_details.json +8 -0
- data/test/fixtures/list_stats.json +26 -0
- data/test/fixtures/list_webhooks.json +18 -0
- data/test/fixtures/lists.json +10 -0
- data/test/fixtures/listsforemail.json +14 -0
- data/test/fixtures/oauth_exchange_token.json +5 -0
- data/test/fixtures/oauth_exchange_token_error.json +4 -0
- data/test/fixtures/oauth_refresh_token_error.json +4 -0
- data/test/fixtures/people.json +14 -0
- data/test/fixtures/person_details.json +6 -0
- data/test/fixtures/refresh_oauth_token.json +5 -0
- data/test/fixtures/revoked_oauth_token_api_error.json +4 -0
- data/test/fixtures/scheduled_campaigns.json +30 -0
- data/test/fixtures/segment_details.json +24 -0
- data/test/fixtures/segment_subscribers.json +27 -0
- data/test/fixtures/segments.json +12 -0
- data/test/fixtures/subscriber_details.json +23 -0
- data/test/fixtures/subscriber_details_with_track_and_sms_pref.json +25 -0
- data/test/fixtures/subscriber_history.json +45 -0
- data/test/fixtures/suppressionlist.json +41 -0
- data/test/fixtures/systemdate.json +3 -0
- data/test/fixtures/tags.json +10 -0
- data/test/fixtures/template_details.json +6 -0
- data/test/fixtures/templates.json +14 -0
- data/test/fixtures/timezones.json +99 -0
- data/test/fixtures/transfer_credits.json +4 -0
- data/test/fixtures/tx_classicemail_groups.json +14 -0
- data/test/fixtures/tx_message_details.json +36 -0
- data/test/fixtures/tx_message_details_with_statistics.json +72 -0
- data/test/fixtures/tx_messages.json +38 -0
- data/test/fixtures/tx_messages_classic.json +15 -0
- data/test/fixtures/tx_messages_smart.json +15 -0
- data/test/fixtures/tx_resend_message.json +6 -0
- data/test/fixtures/tx_send_multiple.json +12 -0
- data/test/fixtures/tx_send_single.json +7 -0
- data/test/fixtures/tx_smartemail_details.json +23 -0
- data/test/fixtures/tx_smartemails.json +15 -0
- data/test/fixtures/tx_statistics_classic.json +14 -0
- data/test/fixtures/tx_statistics_smart.json +14 -0
- data/test/fixtures/unconfirmed_subscribers.json +43 -0
- data/test/fixtures/unsubscribed_subscribers.json +61 -0
- data/test/fixtures/update_custom_field.json +1 -0
- data/test/helper.rb +79 -0
- data/test/journey_test.rb +156 -0
- data/test/list_test.rb +288 -0
- data/test/person_test.rb +39 -0
- data/test/segment_test.rb +74 -0
- data/test/subscriber_test.rb +177 -0
- data/test/template_test.rb +36 -0
- data/test/transactional_classic_email_test.rb +60 -0
- data/test/transactional_smart_email_test.rb +83 -0
- data/test/transactional_timeline_test.rb +110 -0
- metadata +431 -0
@@ -0,0 +1,99 @@
|
|
1
|
+
[
|
2
|
+
"(GMT) Casablanca",
|
3
|
+
"(GMT) Coordinated Universal Time",
|
4
|
+
"(GMT) Greenwich Mean Time : Dublin, Edinburgh, Lisbon, London",
|
5
|
+
"(GMT) Monrovia, Reykjavik",
|
6
|
+
"(GMT+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna",
|
7
|
+
"(GMT+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague",
|
8
|
+
"(GMT+01:00) Brussels, Copenhagen, Madrid, Paris",
|
9
|
+
"(GMT+01:00) Sarajevo, Skopje, Warsaw, Zagreb",
|
10
|
+
"(GMT+01:00) West Central Africa",
|
11
|
+
"(GMT+02:00) Amman",
|
12
|
+
"(GMT+02:00) Athens, Bucharest, Istanbul",
|
13
|
+
"(GMT+02:00) Beirut",
|
14
|
+
"(GMT+02:00) Cairo",
|
15
|
+
"(GMT+02:00) Damascus",
|
16
|
+
"(GMT+02:00) Harare, Pretoria",
|
17
|
+
"(GMT+02:00) Helsinki, Kyiv, Riga, Sofia, Tallinn, Vilnius",
|
18
|
+
"(GMT+02:00) Jerusalem",
|
19
|
+
"(GMT+02:00) Minsk",
|
20
|
+
"(GMT+02:00) Windhoek",
|
21
|
+
"(GMT+03:00) Baghdad",
|
22
|
+
"(GMT+03:00) Kuwait, Riyadh",
|
23
|
+
"(GMT+03:00) Moscow, St. Petersburg, Volgograd",
|
24
|
+
"(GMT+03:00) Nairobi",
|
25
|
+
"(GMT+03:30) Tehran",
|
26
|
+
"(GMT+04:00) Abu Dhabi, Muscat",
|
27
|
+
"(GMT+04:00) Baku",
|
28
|
+
"(GMT+04:00) Port Louis",
|
29
|
+
"(GMT+04:00) Tbilisi",
|
30
|
+
"(GMT+04:00) Yerevan",
|
31
|
+
"(GMT+04:30) Kabul",
|
32
|
+
"(GMT+05:00) Ekaterinburg",
|
33
|
+
"(GMT+05:00) Islamabad, Karachi",
|
34
|
+
"(GMT+05:00) Tashkent",
|
35
|
+
"(GMT+05:30) Chennai, Kolkata, Mumbai, New Delhi",
|
36
|
+
"(GMT+05:30) Sri Jayawardenepura",
|
37
|
+
"(GMT+05:45) Kathmandu",
|
38
|
+
"(GMT+06:00) Astana",
|
39
|
+
"(GMT+06:00) Dhaka",
|
40
|
+
"(GMT+06:00) Novosibirsk",
|
41
|
+
"(GMT+06:30) Yangon (Rangoon)",
|
42
|
+
"(GMT+07:00) Bangkok, Hanoi, Jakarta",
|
43
|
+
"(GMT+07:00) Krasnoyarsk",
|
44
|
+
"(GMT+08:00) Beijing, Chongqing, Hong Kong, Urumqi",
|
45
|
+
"(GMT+08:00) Irkutsk",
|
46
|
+
"(GMT+08:00) Kuala Lumpur, Singapore",
|
47
|
+
"(GMT+08:00) Perth",
|
48
|
+
"(GMT+08:00) Taipei",
|
49
|
+
"(GMT+08:00) Ulaanbaatar",
|
50
|
+
"(GMT+09:00) Osaka, Sapporo, Tokyo",
|
51
|
+
"(GMT+09:00) Seoul",
|
52
|
+
"(GMT+09:00) Yakutsk",
|
53
|
+
"(GMT+09:30) Adelaide",
|
54
|
+
"(GMT+09:30) Darwin",
|
55
|
+
"(GMT+10:00) Brisbane",
|
56
|
+
"(GMT+10:00) Canberra, Melbourne, Sydney",
|
57
|
+
"(GMT+10:00) Guam, Port Moresby",
|
58
|
+
"(GMT+10:00) Hobart",
|
59
|
+
"(GMT+10:00) Vladivostok",
|
60
|
+
"(GMT+11:00) Magadan, Solomon Is., New Caledonia",
|
61
|
+
"(GMT+12:00) Auckland, Wellington",
|
62
|
+
"(GMT+12:00) Coordinated Universal Time+12",
|
63
|
+
"(GMT+12:00) Fiji",
|
64
|
+
"(GMT+12:00) Petropavlovsk-Kamchatsky - Old",
|
65
|
+
"(GMT+13:00) Nuku'alofa",
|
66
|
+
"(GMT-01:00) Azores",
|
67
|
+
"(GMT-01:00) Cape Verde Is.",
|
68
|
+
"(GMT-02:00) Coordinated Universal Time-02",
|
69
|
+
"(GMT-02:00) Mid-Atlantic",
|
70
|
+
"(GMT-03:00) Brasilia",
|
71
|
+
"(GMT-03:00) Buenos Aires",
|
72
|
+
"(GMT-03:00) Cayenne, Fortaleza",
|
73
|
+
"(GMT-03:00) Greenland",
|
74
|
+
"(GMT-03:00) Montevideo",
|
75
|
+
"(GMT-03:30) Newfoundland",
|
76
|
+
"(GMT-04:00) Asuncion",
|
77
|
+
"(GMT-04:00) Atlantic Time (Canada)",
|
78
|
+
"(GMT-04:00) Cuiaba",
|
79
|
+
"(GMT-04:00) Georgetown, La Paz, Manaus, San Juan",
|
80
|
+
"(GMT-04:00) Santiago",
|
81
|
+
"(GMT-04:30) Caracas",
|
82
|
+
"(GMT-05:00) Bogota, Lima, Quito",
|
83
|
+
"(GMT-05:00) Eastern Time (US & Canada)",
|
84
|
+
"(GMT-05:00) Indiana (East)",
|
85
|
+
"(GMT-06:00) Central America",
|
86
|
+
"(GMT-06:00) Central Time (US & Canada)",
|
87
|
+
"(GMT-06:00) Guadalajara, Mexico City, Monterrey",
|
88
|
+
"(GMT-06:00) Saskatchewan",
|
89
|
+
"(GMT-07:00) Arizona",
|
90
|
+
"(GMT-07:00) Chihuahua, La Paz, Mazatlan",
|
91
|
+
"(GMT-07:00) Mountain Time (US & Canada)",
|
92
|
+
"(GMT-08:00) Baja California",
|
93
|
+
"(GMT-08:00) Pacific Time (US & Canada)",
|
94
|
+
"(GMT-09:00) Alaska",
|
95
|
+
"(GMT-10:00) Hawaii",
|
96
|
+
"(GMT-11:00) Coordinated Universal Time-11",
|
97
|
+
"(GMT-11:00) Samoa",
|
98
|
+
"(GMT-12:00) International Date Line West"
|
99
|
+
]
|
@@ -0,0 +1,14 @@
|
|
1
|
+
[
|
2
|
+
{
|
3
|
+
"Group": "Password Reset",
|
4
|
+
"CreatedAt": "2015-03-28T09:41:36+11:00"
|
5
|
+
},
|
6
|
+
{
|
7
|
+
"Group": "Credit card expired",
|
8
|
+
"CreatedAt": "2015-05-04T22:24:12+10:00"
|
9
|
+
},
|
10
|
+
{
|
11
|
+
"Group": "Order shipped",
|
12
|
+
"CreatedAt": "2015-03-29T11:11:52+11:00"
|
13
|
+
}
|
14
|
+
]
|
@@ -0,0 +1,36 @@
|
|
1
|
+
{
|
2
|
+
"MessageID": "ddc697c7-0788-4df3-a71a-a7cb935f00bd",
|
3
|
+
"Status": "Delivered",
|
4
|
+
"SentAt": "2014-01-15T16:09:19-05:00",
|
5
|
+
"SmartEmailID": "c0da9c4c-e7e4-11e4-a74d-6c4008bc7468",
|
6
|
+
"CanBeResent": true,
|
7
|
+
"Recipient": "Joe Smith <joesmith@example.com>",
|
8
|
+
"Message": {
|
9
|
+
"From": "Team Webapp <team@webapp123.com",
|
10
|
+
"Subject": "Thanks for signing up to web app 123",
|
11
|
+
"To": [
|
12
|
+
"Joe Smith <joesmith@example.com>",
|
13
|
+
"jamesmith@example.com"
|
14
|
+
],
|
15
|
+
"CC": [
|
16
|
+
"Joe Smith <joesmith@example.com>"
|
17
|
+
],
|
18
|
+
"BCC": "joesmith@example.com",
|
19
|
+
"Attachments": [
|
20
|
+
{
|
21
|
+
"Name": "Invoice.pdf",
|
22
|
+
"Type": "application/pdf"
|
23
|
+
}
|
24
|
+
],
|
25
|
+
"Body": {
|
26
|
+
"Html": "...",
|
27
|
+
"Text": "..."
|
28
|
+
},
|
29
|
+
"Data": {
|
30
|
+
"new_password_url": "https://www.mywebapp.com/newpassword?uid=jguf45hf74hbf74gf"
|
31
|
+
}
|
32
|
+
},
|
33
|
+
"TotalOpens": 1,
|
34
|
+
"TotalClicks": 1
|
35
|
+
}
|
36
|
+
|
@@ -0,0 +1,72 @@
|
|
1
|
+
{
|
2
|
+
"MessageID": "ddc697c7-0788-4df3-a71a-a7cb935f00bd",
|
3
|
+
"Status": "Delivered",
|
4
|
+
"SentAt": "2014-01-15T16:09:19-05:00",
|
5
|
+
"SmartEmailID": "c0da9c4c-e7e4-11e4-a74d-6c4008bc7468",
|
6
|
+
"CanBeResent": true,
|
7
|
+
"Recipient": "Joe Smith <joesmith@example.com>",
|
8
|
+
"Message": {
|
9
|
+
"From": "Team Webapp <team@webapp123.com",
|
10
|
+
"Subject": "Thanks for signing up to web app 123",
|
11
|
+
"To": [
|
12
|
+
"Joe Smith <joesmith@example.com>",
|
13
|
+
"jamesmith@example.com"
|
14
|
+
],
|
15
|
+
"CC": [
|
16
|
+
"Joe Smith <joesmith@example.com>"
|
17
|
+
],
|
18
|
+
"BCC": "joesmith@example.com",
|
19
|
+
"Attachments": [
|
20
|
+
{
|
21
|
+
"Name": "Invoice.pdf",
|
22
|
+
"Type": "application/pdf"
|
23
|
+
}
|
24
|
+
],
|
25
|
+
"Body": {
|
26
|
+
"Html": "...",
|
27
|
+
"Text": "..."
|
28
|
+
},
|
29
|
+
"Data": {
|
30
|
+
"new_password_url": "https://www.mywebapp.com/newpassword?uid=jguf45hf74hbf74gf"
|
31
|
+
}
|
32
|
+
},
|
33
|
+
"TotalOpens": 1,
|
34
|
+
"TotalClicks": 1,
|
35
|
+
"Opens": [
|
36
|
+
{
|
37
|
+
"EmailAddress": "jamesmith@example.com",
|
38
|
+
"Date": "2009-05-18 16:45:00",
|
39
|
+
"IPAddress": "192.168.0.1",
|
40
|
+
"Geolocation": {
|
41
|
+
"Latitude": -33.8683,
|
42
|
+
"Longitude": 151.2086,
|
43
|
+
"City": "Sydney",
|
44
|
+
"Region": "New South Wales",
|
45
|
+
"CountryCode": "AU",
|
46
|
+
"CountryName": "Australia"
|
47
|
+
},
|
48
|
+
"MailClient": {
|
49
|
+
"Name": "Apple Mail",
|
50
|
+
"OS": "OS X",
|
51
|
+
"Device": "Desktop"
|
52
|
+
}
|
53
|
+
}
|
54
|
+
],
|
55
|
+
"Clicks": [
|
56
|
+
{
|
57
|
+
"EmailAddress": "jamesmith@example.com",
|
58
|
+
"Date": "2009-05-18 16:45:00",
|
59
|
+
"IPAddress": "192.168.0.1",
|
60
|
+
"URL": "http://www.myexammple.com/index.html",
|
61
|
+
"Geolocation": {
|
62
|
+
"Latitude": -33.8683,
|
63
|
+
"Longitude": 151.2086,
|
64
|
+
"City": "Sydney",
|
65
|
+
"Region": "New South Wales",
|
66
|
+
"CountryCode": "AU",
|
67
|
+
"CountryName": "Australia"
|
68
|
+
}
|
69
|
+
}
|
70
|
+
]
|
71
|
+
}
|
72
|
+
|
@@ -0,0 +1,38 @@
|
|
1
|
+
[
|
2
|
+
{
|
3
|
+
"MessageID": "ddc697c7-0788-4df3-a71a-a7cb935f00bd",
|
4
|
+
"Status": "Delivered",
|
5
|
+
"SentAt": "2014-01-15T16:09:19-05:00",
|
6
|
+
"Recipient": "Joe Smith <joesmith@example.com>",
|
7
|
+
"From": "Team <team@company.com>",
|
8
|
+
"Subject": "Ungrouped message",
|
9
|
+
"TotalOpens": 2,
|
10
|
+
"TotalClicks": 4,
|
11
|
+
"CanBeResent": true
|
12
|
+
},
|
13
|
+
{
|
14
|
+
"MessageID": "ddc697c7-0788-4df3-a71a-a7cb935f00bd",
|
15
|
+
"Status": "Delivered",
|
16
|
+
"SentAt": "2014-01-15T16:09:19-05:00",
|
17
|
+
"Recipient": "Joe Smith <joesmith@example.com>",
|
18
|
+
"From": "Team <team@company.com>",
|
19
|
+
"Subject": "Your password has been reset",
|
20
|
+
"TotalOpens": 2,
|
21
|
+
"TotalClicks": 4,
|
22
|
+
"CanBeResent": true,
|
23
|
+
"Group": "Password Reset"
|
24
|
+
},
|
25
|
+
{
|
26
|
+
"MessageID": "ddc697c7-0788-4df3-a71a-a7cb935f00bd",
|
27
|
+
"Status": "Delivered",
|
28
|
+
"SentAt": "2014-01-15T16:09:19-05:00",
|
29
|
+
"Recipient": "Joe Smith <joesmith@example.com>",
|
30
|
+
"From": "Team <team@company.com>",
|
31
|
+
"Subject": "Your credit card has expired",
|
32
|
+
"TotalOpens": 2,
|
33
|
+
"TotalClicks": 4,
|
34
|
+
"CanBeResent": true,
|
35
|
+
"SmartEmailID": "21dab350-f484-11e4-ad38-6c4008bc7468"
|
36
|
+
}
|
37
|
+
]
|
38
|
+
|
@@ -0,0 +1,15 @@
|
|
1
|
+
[
|
2
|
+
{
|
3
|
+
"MessageID": "ddc697c7-0788-4df3-a71a-a7cb935f00bd",
|
4
|
+
"Status": "Delivered",
|
5
|
+
"SentAt": "2014-01-15T16:09:19-05:00",
|
6
|
+
"Recipient": "Joe Smith <joesmith@example.com>",
|
7
|
+
"From": "Team <team@company.com>",
|
8
|
+
"Subject": "Your password has been reset",
|
9
|
+
"TotalOpens": 2,
|
10
|
+
"TotalClicks": 4,
|
11
|
+
"CanBeResent": true,
|
12
|
+
"Group": "Password Reset"
|
13
|
+
}
|
14
|
+
]
|
15
|
+
|
@@ -0,0 +1,15 @@
|
|
1
|
+
[
|
2
|
+
{
|
3
|
+
"MessageID": "ddc697c7-0788-4df3-a71a-a7cb935f00bd",
|
4
|
+
"Status": "Delivered",
|
5
|
+
"SentAt": "2014-01-15T16:09:19-05:00",
|
6
|
+
"Recipient": "Joe Smith <joesmith@example.com>",
|
7
|
+
"From": "Team <team@company.com>",
|
8
|
+
"Subject": "Your credit card has expired",
|
9
|
+
"TotalOpens": 2,
|
10
|
+
"TotalClicks": 4,
|
11
|
+
"CanBeResent": true,
|
12
|
+
"SmartEmailID": "21dab350-f484-11e4-ad38-6c4008bc7468"
|
13
|
+
}
|
14
|
+
]
|
15
|
+
|
@@ -0,0 +1,12 @@
|
|
1
|
+
[
|
2
|
+
{
|
3
|
+
"MessageID": "0cfe150d-d507-11e4-84a7-c31e5b59881d",
|
4
|
+
"Recipient": "\"Bob Sacamano\" <bob@example.com>",
|
5
|
+
"Status": "Received"
|
6
|
+
},
|
7
|
+
{
|
8
|
+
"MessageID": "0cfe150d-d507-11e4-b579-a64eb0d9c74d",
|
9
|
+
"Recipient": "\"Newman\" <newman@example.com>",
|
10
|
+
"Status": "Received"
|
11
|
+
}
|
12
|
+
]
|
@@ -0,0 +1,23 @@
|
|
1
|
+
{
|
2
|
+
"SmartEmailID": "bb4a6ebb-663d-42a0-bdbe-60512cf30a01",
|
3
|
+
"Name": "Reset Password",
|
4
|
+
"CreatedAt": "2015-03-31T16:06:35+11:00",
|
5
|
+
"Status": "active",
|
6
|
+
"Properties": {
|
7
|
+
"From": "\"Team\" <team@example.com>",
|
8
|
+
"ReplyTo": "joe@example.com",
|
9
|
+
"Subject": "[username], your password has been reset!",
|
10
|
+
"Content": {
|
11
|
+
"HTML": "Content managed in Email Builder",
|
12
|
+
"Text": "Content managed in Email Builder",
|
13
|
+
"EmailVariables": [
|
14
|
+
"username",
|
15
|
+
"reset_token"
|
16
|
+
],
|
17
|
+
"InlineCss": true
|
18
|
+
},
|
19
|
+
"TextPreviewUrl": "https://philoye.devcreatesend.com/t/r-9A7A28EE76054977/T",
|
20
|
+
"HtmlPreviewUrl": "https://philoye.devcreatesend.com/t/r-9A7A28EE76054977/"
|
21
|
+
},
|
22
|
+
"AddRecipientsToList": true
|
23
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
[
|
2
|
+
{
|
3
|
+
"ID": "1e654df2-f484-11e4-970c-6c4008bc7468",
|
4
|
+
"Name": "Welcome email",
|
5
|
+
"CreatedAt": "2015-05-15T16:09:19-05:00",
|
6
|
+
"Status": "Active"
|
7
|
+
},
|
8
|
+
{
|
9
|
+
"ID": "21dab350-f484-11e4-ad38-6c4008bc7468",
|
10
|
+
"Name": "Order shipped",
|
11
|
+
"CreatedAt": "2015-05-15T13:29:49-05:00",
|
12
|
+
"Status": "Active"
|
13
|
+
}
|
14
|
+
]
|
15
|
+
|
@@ -0,0 +1,43 @@
|
|
1
|
+
{
|
2
|
+
"Results": [
|
3
|
+
{
|
4
|
+
"EmailAddress": "subs+7t8787Y@example.com",
|
5
|
+
"Name": "Unconfirmed One",
|
6
|
+
"Date": "2010-10-25 10:28:00",
|
7
|
+
"ListJoinedDate": "2010-10-25 10:28:00",
|
8
|
+
"State": "Unconfirmed",
|
9
|
+
"CustomFields": [
|
10
|
+
{
|
11
|
+
"Key": "website",
|
12
|
+
"Value": "http://example.com"
|
13
|
+
}
|
14
|
+
],
|
15
|
+
"ReadsEmailWith": "",
|
16
|
+
"ConsentToTrack": "Yes",
|
17
|
+
"ConsentToSendSms": "No"
|
18
|
+
},
|
19
|
+
{
|
20
|
+
"EmailAddress": "subs+7878787y8ggg@example.com",
|
21
|
+
"Name": "Unconfirmed Two",
|
22
|
+
"Date": "2010-10-25 12:17:00",
|
23
|
+
"ListJoinedDate": "2010-10-25 12:17:00",
|
24
|
+
"State": "Unconfirmed",
|
25
|
+
"CustomFields": [
|
26
|
+
{
|
27
|
+
"Key": "website",
|
28
|
+
"Value": "http://subdomain.example.com"
|
29
|
+
}
|
30
|
+
],
|
31
|
+
"ReadsEmailWith": "",
|
32
|
+
"ConsentToTrack": "No",
|
33
|
+
"ConsentToSendSms": "No"
|
34
|
+
}
|
35
|
+
],
|
36
|
+
"ResultsOrderedBy": "email",
|
37
|
+
"OrderDirection": "asc",
|
38
|
+
"PageNumber": 1,
|
39
|
+
"PageSize": 1000,
|
40
|
+
"RecordsOnThisPage": 2,
|
41
|
+
"TotalNumberOfRecords": 2,
|
42
|
+
"NumberOfPages": 1
|
43
|
+
}
|
@@ -0,0 +1,61 @@
|
|
1
|
+
{
|
2
|
+
"Results": [
|
3
|
+
{
|
4
|
+
"EmailAddress": "subscriber@example.com",
|
5
|
+
"Name": "Unsub One",
|
6
|
+
"Date": "2010-10-25 13:11:00",
|
7
|
+
"ListJoinedDate": "2010-10-25 13:11:00",
|
8
|
+
"State": "Unsubscribed",
|
9
|
+
"CustomFields": [],
|
10
|
+
"ReadsEmailWith": "Gmail"
|
11
|
+
},
|
12
|
+
{
|
13
|
+
"EmailAddress": "subscriberone@example.com",
|
14
|
+
"Name": "Subscriber",
|
15
|
+
"Date": "2010-10-25 13:04:00",
|
16
|
+
"ListJoinedDate": "2010-10-25 13:04:00",
|
17
|
+
"State": "Unsubscribed",
|
18
|
+
"CustomFields": [
|
19
|
+
{
|
20
|
+
"Key": "website",
|
21
|
+
"Value": "http://google.com"
|
22
|
+
}
|
23
|
+
],
|
24
|
+
"ReadsEmailWith": "Gmail"
|
25
|
+
},
|
26
|
+
{
|
27
|
+
"EmailAddress": "example+1@example.com",
|
28
|
+
"Name": "Example One",
|
29
|
+
"Date": "2010-10-26 10:56:00",
|
30
|
+
"ListJoinedDate": "2010-10-26 10:56:00",
|
31
|
+
"State": "Unsubscribed",
|
32
|
+
"CustomFields": [],
|
33
|
+
"ReadsEmailWith": ""
|
34
|
+
},
|
35
|
+
{
|
36
|
+
"EmailAddress": "example+2@example.com",
|
37
|
+
"Name": "Example Two",
|
38
|
+
"Date": "2010-10-26 10:56:00",
|
39
|
+
"ListJoinedDate": "2010-10-26 10:56:00",
|
40
|
+
"State": "Unsubscribed",
|
41
|
+
"CustomFields": [],
|
42
|
+
"ReadsEmailWith": ""
|
43
|
+
},
|
44
|
+
{
|
45
|
+
"EmailAddress": "example+3@example.com",
|
46
|
+
"Name": "Example Three",
|
47
|
+
"Date": "2010-10-26 10:56:00",
|
48
|
+
"ListJoinedDate": "2010-10-26 10:56:00",
|
49
|
+
"State": "Unsubscribed",
|
50
|
+
"CustomFields": [],
|
51
|
+
"ReadsEmailWith": "Gmail"
|
52
|
+
}
|
53
|
+
],
|
54
|
+
"ResultsOrderedBy": "email",
|
55
|
+
"OrderDirection": "asc",
|
56
|
+
"PageNumber": 1,
|
57
|
+
"PageSize": 1000,
|
58
|
+
"RecordsOnThisPage": 5,
|
59
|
+
"TotalNumberOfRecords": 5,
|
60
|
+
"NumberOfPages": 1
|
61
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
"[myrenamedcustomfield]"
|
data/test/helper.rb
ADDED
@@ -0,0 +1,79 @@
|
|
1
|
+
require 'simplecov'
|
2
|
+
require 'coveralls'
|
3
|
+
|
4
|
+
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new([
|
5
|
+
SimpleCov::Formatter::HTMLFormatter,
|
6
|
+
Coveralls::SimpleCov::Formatter
|
7
|
+
])
|
8
|
+
SimpleCov.start
|
9
|
+
|
10
|
+
require 'test/unit'
|
11
|
+
require 'pathname'
|
12
|
+
|
13
|
+
require 'shoulda/context'
|
14
|
+
require 'matchy'
|
15
|
+
require 'fakeweb'
|
16
|
+
|
17
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
18
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
19
|
+
require 'createsend'
|
20
|
+
|
21
|
+
FakeWeb.allow_net_connect = %r[^https?://coveralls.io]
|
22
|
+
|
23
|
+
def fixture_file(filename)
|
24
|
+
return '' if filename == ''
|
25
|
+
file_path = File.expand_path(File.dirname(__FILE__) + '/fixtures/' + filename)
|
26
|
+
File.read(file_path)
|
27
|
+
end
|
28
|
+
|
29
|
+
def createsend_url(auth, url)
|
30
|
+
if not url =~ /^http/
|
31
|
+
auth_section = ''
|
32
|
+
auth_section = "#{auth[:api_key]}:x@" if auth and auth.has_key? :api_key
|
33
|
+
result = "https://#{auth_section}api.createsend.com/api/v3.3/#{url}"
|
34
|
+
else
|
35
|
+
result = url
|
36
|
+
end
|
37
|
+
result
|
38
|
+
end
|
39
|
+
|
40
|
+
def stub_request(method, auth, url, filename, status=nil)
|
41
|
+
options = {:body => ""}
|
42
|
+
options.merge!({:body => fixture_file(filename)}) if filename
|
43
|
+
options.merge!({:status => status}) if status
|
44
|
+
options.merge!(:content_type => "application/json; charset=utf-8")
|
45
|
+
createsend_url = createsend_url(auth, url)
|
46
|
+
FakeWeb.register_uri(method, createsend_url, options)
|
47
|
+
end
|
48
|
+
|
49
|
+
def stub_get(*args); stub_request(:get, *args) end
|
50
|
+
def stub_post(*args); stub_request(:post, *args) end
|
51
|
+
def stub_put(*args); stub_request(:put, *args) end
|
52
|
+
def stub_delete(*args); stub_request(:delete, *args) end
|
53
|
+
|
54
|
+
def multiple_contexts(*contexts, &blk)
|
55
|
+
contexts.each do |context|
|
56
|
+
send(context, &blk)
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
def authenticated_using_oauth_context(&blk)
|
61
|
+
context "when an api caller is authenticated using oauth" do
|
62
|
+
setup do
|
63
|
+
@access_token = 'joidjo2i3joi3je'
|
64
|
+
@refresh_token = 'j89u98eu9e8ufe'
|
65
|
+
@auth = {:access_token => @access_token, :refresh_token => @refresh_token}
|
66
|
+
end
|
67
|
+
merge_block(&blk)
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
def authenticated_using_api_key_context(&blk)
|
72
|
+
context "when an api caller is authenticated using an api key" do
|
73
|
+
setup do
|
74
|
+
@api_key = '123123123123123123123'
|
75
|
+
@auth = {:api_key => @api_key}
|
76
|
+
end
|
77
|
+
merge_block(&blk)
|
78
|
+
end
|
79
|
+
end
|