contactology 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. data/.infinity_test +1 -1
  2. data/.travis.yml +5 -0
  3. data/Gemfile +3 -0
  4. data/README.markdown +64 -0
  5. data/Rakefile +4 -0
  6. data/contactology.gemspec +1 -0
  7. data/lib/contactology.rb +2 -0
  8. data/lib/contactology/api.rb +2 -0
  9. data/lib/contactology/basic_object.rb +2 -0
  10. data/lib/contactology/campaign.rb +2 -0
  11. data/lib/contactology/campaign/preview.rb +2 -0
  12. data/lib/contactology/campaigns.rb +2 -0
  13. data/lib/contactology/campaigns/standard.rb +2 -0
  14. data/lib/contactology/campaigns/transactional.rb +2 -0
  15. data/lib/contactology/configuration.rb +2 -0
  16. data/lib/contactology/contact.rb +2 -0
  17. data/lib/contactology/errors.rb +2 -0
  18. data/lib/contactology/issue.rb +2 -0
  19. data/lib/contactology/issues.rb +2 -0
  20. data/lib/contactology/list.rb +2 -0
  21. data/lib/contactology/list_proxy.rb +2 -0
  22. data/lib/contactology/parser.rb +35 -0
  23. data/lib/contactology/send_result.rb +2 -0
  24. data/lib/contactology/stash.rb +2 -0
  25. data/lib/contactology/transactional_message.rb +2 -0
  26. data/lib/contactology/version.rb +3 -1
  27. data/spec/contactology.example.yml +1 -0
  28. data/spec/factories/campaigns.rb +2 -0
  29. data/spec/factories/contacts.rb +2 -0
  30. data/spec/factories/issues.rb +2 -0
  31. data/spec/factories/lists.rb +2 -0
  32. data/spec/factories/transactional_messages.rb +2 -0
  33. data/spec/fixtures/net/campaign/destroy.yml +170 -168
  34. data/spec/fixtures/net/campaign/find/success.yml +227 -120
  35. data/spec/fixtures/net/campaign/find_by_name/success.yml +215 -143
  36. data/spec/fixtures/net/campaign/preview.yml +136 -61
  37. data/spec/models/contactology/api_spec.rb +2 -0
  38. data/spec/models/contactology/campaign_spec.rb +6 -3
  39. data/spec/models/contactology/campaigns/standard_spec.rb +2 -0
  40. data/spec/models/contactology/campaigns/transactional_spec.rb +2 -0
  41. data/spec/models/contactology/configuration_spec.rb +2 -0
  42. data/spec/models/contactology/contact_spec.rb +2 -0
  43. data/spec/models/contactology/issues_spec.rb +2 -0
  44. data/spec/models/contactology/list_spec.rb +2 -0
  45. data/spec/models/contactology/send_result_spec.rb +2 -0
  46. data/spec/models/contactology/stash_spec.rb +2 -0
  47. data/spec/models/contactology/transactional_message_spec.rb +2 -0
  48. data/spec/models/contactology_spec.rb +2 -0
  49. data/spec/requests/contacts_spec.rb +2 -0
  50. data/spec/spec_helper.rb +2 -0
  51. data/spec/support/contactology.rb +2 -0
  52. data/spec/support/factory_girl.rb +2 -0
  53. data/spec/support/vcr.rb +2 -0
  54. metadata +98 -87
@@ -2,7 +2,7 @@
2
2
 
3
3
  infinity_test do
4
4
  notifications :growl
5
- use :rubies => %w(1.9.2-p180 1.8.7-p334), :gemset => 'contactology', :test_framework => :rspec
5
+ use :rubies => %w(1.9.2-p180 1.9.2-p290 1.8.7-p334), :gemset => 'contactology', :test_framework => :rspec
6
6
 
7
7
  before_run do
8
8
  clear :terminal
@@ -0,0 +1,5 @@
1
+ rvm:
2
+ - ree
3
+ - 1.8.7
4
+ - 1.9.2
5
+ script: "cp spec/contactology.example.yml spec/contactology.yml; bundle exec rake spec"
data/Gemfile CHANGED
@@ -1,6 +1,9 @@
1
1
  source 'http://rubygems.org'
2
2
  gemspec
3
3
 
4
+ gem 'json_pure'
5
+
4
6
  group :development, :test do
7
+ gem 'rake'
5
8
  gem 'webmock', :git => 'https://github.com/bblimke/webmock.git', :ref => 'af4c05480571905be786fc35b8b9703c3ea7fe6c'
6
9
  end
@@ -0,0 +1,64 @@
1
+ # Contactology [![Build status][ci-image]][ci]
2
+
3
+ This library provides a Ruby interface to the [Contactology email marketing
4
+ API][api].
5
+
6
+ ## Quick start
7
+
8
+ ```ruby
9
+ require 'contactology'
10
+
11
+ Contactology.key = 'aBcDeFg12345'
12
+
13
+ list = Contactology::List.find(4)
14
+ # => #<Contactology::List:0x000... @list_id="4" @name="test list" ...>
15
+
16
+ list.subscribe('joe@example.local')
17
+ # => true
18
+
19
+ contact = Contactology::Contact.find('joe@example.local')
20
+ # => #<Contactology::Contact:0x000... @email="joe@example.local" ...>
21
+
22
+ contact.lists
23
+ # => [#<Contactology::List:0x000... @list_id="4" ...>]
24
+
25
+ campaign = Contactology::Campaign.find_by_name('test campaign')
26
+ # => #<Contactology::Campaign:0x000... @name="test campaign" ...>
27
+
28
+ result = campaign.send_campaign
29
+ # => #<Contactology::SendResult:0x000... @success=true @issues=[]>
30
+
31
+ result.successful?
32
+ # => true
33
+
34
+ result.issues
35
+ # => []
36
+ ```
37
+
38
+ ## API support
39
+
40
+ This library supports the Contactology V2, or "REST," API.
41
+
42
+ ### Intentions
43
+
44
+ This library is not currently intended to fully implement all of the API
45
+ methods which Contactology makes available. Instead, it will focus on those
46
+ methods which are of immediate practical use in production applications. This
47
+ should ensure that the interface is well exercised and continuously updated.
48
+
49
+ Feel free to fork and submit pull requests to expand the feature set to meet
50
+ your needs.
51
+
52
+ ## Ruby compatibility
53
+
54
+ This library uses [Travis CI][ci] to continuously test and remain compatible
55
+ with the following Rubies:
56
+
57
+ * MRI Ruby 1.8.7,
58
+ * MRI Ruby 1.9.2, and
59
+ * REE 1.8.7
60
+
61
+
62
+ [api]: http://www.contactology.com/email-marketing-api/ (Contactology API Documentation)
63
+ [ci]: http://travis-ci.org/nbibler/contactology
64
+ [ci-image]: https://secure.travis-ci.org/nbibler/contactology.png
data/Rakefile CHANGED
@@ -1 +1,5 @@
1
1
  require 'bundler/gem_tasks'
2
+
3
+ require 'rspec/core/rake_task'
4
+ RSpec::Core::RakeTask.new(:spec)
5
+ task :default => :spec
@@ -18,6 +18,7 @@ Gem::Specification.new do |s|
18
18
 
19
19
  s.add_dependency 'hashie', '~> 1.1'
20
20
  s.add_dependency 'httparty'
21
+ s.add_dependency 'multi_json'
21
22
 
22
23
  s.add_development_dependency 'vcr', '~> 1.5'
23
24
  s.add_development_dependency 'rspec', '~> 2.0'
@@ -1,3 +1,5 @@
1
+ # encoding: UTF-8
2
+
1
3
  require 'contactology/version'
2
4
  require 'contactology/errors'
3
5
  require 'contactology/campaigns/standard'
@@ -1,3 +1,5 @@
1
+ # encoding: UTF-8
2
+
1
3
  require 'httparty'
2
4
  require 'contactology/parser'
3
5
 
@@ -1,3 +1,5 @@
1
+ # encoding: UTF-8
2
+
1
3
  module Contactology
2
4
  if defined? ::BasicObject
3
5
  # A class with no predefined methods that behaves similarly to Builder's
@@ -1,3 +1,5 @@
1
+ # encoding: UTF-8
2
+
1
3
  require 'contactology/stash'
2
4
  require 'contactology/api'
3
5
  require 'contactology/send_result'
@@ -1,3 +1,5 @@
1
+ # encoding: UTF-8
2
+
1
3
  require 'contactology/stash'
2
4
 
3
5
  module Contactology
@@ -1,2 +1,4 @@
1
+ # encoding: UTF-8
2
+
1
3
  module Contactology::Campaigns
2
4
  end
@@ -1,3 +1,5 @@
1
+ # encoding: UTF-8
2
+
1
3
  require 'contactology/campaign'
2
4
  require 'contactology/campaigns'
3
5
 
@@ -1,3 +1,5 @@
1
+ # encoding: UTF-8
2
+
1
3
  require 'contactology/campaign'
2
4
  require 'contactology/campaigns'
3
5
 
@@ -1,3 +1,5 @@
1
+ # encoding: UTF-8
2
+
1
3
  ##
2
4
  # Holds configuration objects used by the library. The Contactology module
3
5
  # holds reference to a default Configuration, which will be used when no
@@ -1,3 +1,5 @@
1
+ # encoding: UTF-8
2
+
1
3
  require 'contactology/stash'
2
4
  require 'contactology/api'
3
5
 
@@ -1,3 +1,5 @@
1
+ # encoding: UTF-8
2
+
1
3
  module Contactology
2
4
  Error = Class.new(StandardError)
3
5
  InvalidObjectError = Class.new(Error)
@@ -1,3 +1,5 @@
1
+ # encoding: UTF-8
2
+
1
3
  module Contactology
2
4
  class Issue
3
5
  attr_reader :type
@@ -1,3 +1,5 @@
1
+ # encoding: UTF-8
2
+
1
3
  require 'contactology/issue'
2
4
 
3
5
  module Contactology
@@ -1,3 +1,5 @@
1
+ # encoding: UTF-8
2
+
1
3
  require 'contactology/stash'
2
4
  require 'contactology/api'
3
5
 
@@ -1,3 +1,5 @@
1
+ # encoding: UTF-8
2
+
1
3
  require 'contactology/basic_object'
2
4
  require 'contactology/list'
3
5
 
@@ -1,5 +1,40 @@
1
+ # encoding: UTF-8
2
+
3
+ # To be removed when Crack is updated, see below.
4
+ require 'multi_json'
5
+
1
6
  module Contactology
2
7
  class Parser < HTTParty::Parser
3
8
  SupportedFormats.merge!({'text/plain' => :json})
9
+
10
+
11
+ protected
12
+
13
+
14
+ ##
15
+ # Private: This was put in place entirely to appease Ruby 1.9.2-p290's more
16
+ # strict YAML parsing, which breaks Crack 0.1.8's JSON decoding.
17
+ #
18
+ # This will be removed when Crack supports decoding the API's returned
19
+ # values.
20
+ #
21
+ def json
22
+ decode_json(body)
23
+ end
24
+
25
+ ##
26
+ # Private: This was put in place entirely to appease Ruby 1.9.2-p290's more
27
+ # strict YAML parsing, which breaks Crack 0.1.8's JSON decoding.
28
+ #
29
+ # This will be removed when Crack supports decoding the API's returned
30
+ # values.
31
+ #
32
+ def decode_json(body)
33
+ if body.to_s =~ /^(?:[\d]+|null|true|false)$/
34
+ MultiJson.decode("[#{body}]").first
35
+ else
36
+ MultiJson.decode body
37
+ end
38
+ end
4
39
  end
5
40
  end
@@ -1,3 +1,5 @@
1
+ # encoding: UTF-8
2
+
1
3
  require 'contactology/issues'
2
4
 
3
5
  module Contactology
@@ -1,3 +1,5 @@
1
+ # encoding: UTF-8
2
+
1
3
  require 'hashie/trash'
2
4
 
3
5
  module Contactology
@@ -1,3 +1,5 @@
1
+ # encoding: UTF-8
2
+
1
3
  require 'contactology/stash'
2
4
 
3
5
  module Contactology
@@ -1,3 +1,5 @@
1
+ # encoding: UTF-8
2
+
1
3
  module Contactology
2
- VERSION = '0.0.1'
4
+ VERSION = '0.0.2'
3
5
  end
@@ -0,0 +1 @@
1
+ key: 'testkey'
@@ -1,3 +1,5 @@
1
+ # encoding: UTF-8
2
+
1
3
  Factory.define :standard_campaign, :class => Contactology::Campaigns::Standard do |c|
2
4
  c.content 'text' => 'This is a good message! {COMPANY_ADDRESS}'
3
5
  c.name 'factory campaign'
@@ -1,3 +1,5 @@
1
+ # encoding: UTF-8
2
+
1
3
  Factory.define :contact, :class => Contactology::Contact do |c|
2
4
  c.email 'factory-contact@example.com'
3
5
  end
@@ -1,3 +1,5 @@
1
+ # encoding: UTF-8
2
+
1
3
  Factory.define :issue, :class => Contactology::Issue do |i|
2
4
  i.level ''
3
5
  i.type 'SPAM'
@@ -1,3 +1,5 @@
1
+ # encoding: UTF-8
2
+
1
3
  Factory.define :list, :class => Contactology::List do |l|
2
4
  l.name 'Factory List'
3
5
  end
@@ -1,3 +1,5 @@
1
+ # encoding: UTF-8
2
+
1
3
  Factory.define :transactional_message, :class => Contactology::TransactionalMessage do |m|
2
4
  m.campaign { Factory.build_via_new :transactional_campaign }
3
5
  m.contact { Factory.attributes_for :contact }
@@ -1,246 +1,248 @@
1
- ---
2
- - !ruby/struct:VCR::HTTPInteraction
3
- request: !ruby/struct:VCR::Request
1
+ ---
2
+ - !ruby/struct:VCR::HTTPInteraction
3
+ request: !ruby/struct:VCR::Request
4
4
  method: :get
5
5
  uri: https://api.emailcampaigns.net:443/2/REST/?key=%{API_KEY}&method=List_Add_Public&name=Factory%20List
6
- body:
7
- headers:
8
- accept:
6
+ body: !!null
7
+ headers:
8
+ accept:
9
9
  - application/json
10
- user-agent:
11
- - contactology/0.0.1 (Rubygems; Ruby 1.9.2 x86_64-darwin10.7.1)
12
- response: !ruby/struct:VCR::Response
13
- status: !ruby/struct:VCR::ResponseStatus
10
+ user-agent:
11
+ - contactology/0.0.1 (Rubygems; Ruby 1.9.2 x86_64-darwin10.8.0)
12
+ response: !ruby/struct:VCR::Response
13
+ status: !ruby/struct:VCR::ResponseStatus
14
14
  code: 200
15
15
  message: OK
16
- headers:
17
- x-powered-by:
16
+ headers:
17
+ x-powered-by:
18
18
  - PHP/5.2.10
19
- set-cookie:
20
- - PHPSESSID=6a8cdfd44b31c3d7987dd6492f075491; path=/
21
- expires:
19
+ set-cookie:
20
+ - PHPSESSID=5858560ae94afdfbcd5c06280a207988; path=/
21
+ expires:
22
22
  - Thu, 19 Nov 1981 08:52:00 GMT
23
- cache-control:
23
+ cache-control:
24
24
  - no-store, no-cache, must-revalidate, post-check=0, pre-check=0
25
- pragma:
25
+ pragma:
26
26
  - no-cache
27
- content-type:
27
+ content-type:
28
28
  - text/plain;charset=UTF-8
29
- transfer-encoding:
29
+ transfer-encoding:
30
30
  - chunked
31
- date:
32
- - Wed, 03 Aug 2011 18:23:53 GMT
33
- server:
31
+ date:
32
+ - Thu, 04 Aug 2011 02:38:47 GMT
33
+ server:
34
34
  - lighttpd/1.4.28
35
- body: "46"
36
- http_version: "1.1"
37
- - !ruby/struct:VCR::HTTPInteraction
38
- request: !ruby/struct:VCR::Request
35
+ body: '57'
36
+ http_version: '1.1'
37
+ - !ruby/struct:VCR::HTTPInteraction
38
+ request: !ruby/struct:VCR::Request
39
39
  method: :get
40
- uri: https://api.emailcampaigns.net:443/2/REST/?key=%{API_KEY}&listId=46&method=List_Get_Info
41
- body:
42
- headers:
43
- accept:
40
+ uri: https://api.emailcampaigns.net:443/2/REST/?key=%{API_KEY}&listId=57&method=List_Get_Info
41
+ body: !!null
42
+ headers:
43
+ accept:
44
44
  - application/json
45
- user-agent:
46
- - contactology/0.0.1 (Rubygems; Ruby 1.9.2 x86_64-darwin10.7.1)
47
- response: !ruby/struct:VCR::Response
48
- status: !ruby/struct:VCR::ResponseStatus
45
+ user-agent:
46
+ - contactology/0.0.1 (Rubygems; Ruby 1.9.2 x86_64-darwin10.8.0)
47
+ response: !ruby/struct:VCR::Response
48
+ status: !ruby/struct:VCR::ResponseStatus
49
49
  code: 200
50
50
  message: OK
51
- headers:
52
- x-powered-by:
51
+ headers:
52
+ x-powered-by:
53
53
  - PHP/5.2.10
54
- set-cookie:
55
- - PHPSESSID=295f4ba34b7f033e8cad0c6cf83b9b75; path=/
56
- expires:
54
+ set-cookie:
55
+ - PHPSESSID=73c27e19065b5c49a29940c5d0019e5a; path=/
56
+ expires:
57
57
  - Thu, 19 Nov 1981 08:52:00 GMT
58
- cache-control:
58
+ cache-control:
59
59
  - no-store, no-cache, must-revalidate, post-check=0, pre-check=0
60
- pragma:
60
+ pragma:
61
61
  - no-cache
62
- content-type:
62
+ content-type:
63
63
  - text/plain;charset=UTF-8
64
- transfer-encoding:
64
+ transfer-encoding:
65
65
  - chunked
66
- date:
67
- - Wed, 03 Aug 2011 18:23:57 GMT
68
- server:
66
+ date:
67
+ - Thu, 04 Aug 2011 02:38:37 GMT
68
+ server:
69
69
  - lighttpd/1.4.28
70
- body: "{\"listId\":\"46\",\"name\":\"Factory List\",\"description\":null,\"type\":\"public\",\"optIn\":false}"
71
- http_version: "1.1"
72
- - !ruby/struct:VCR::HTTPInteraction
73
- request: !ruby/struct:VCR::Request
70
+ body: ! '{"listId":"57","name":"Factory List","description":null,"type":"public","optIn":false}'
71
+ http_version: '1.1'
72
+ - !ruby/struct:VCR::HTTPInteraction
73
+ request: !ruby/struct:VCR::Request
74
74
  method: :get
75
- uri: https://api.emailcampaigns.net:443/2/REST/?campaignName=factory%20campaign&key=%{API_KEY}&method=Campaign_Create_Standard&senderEmail=nate@envylabs.com&senderName=Nate%20Bibler&subject=Factory%20Campaign%20Message&content%5Btext%5D=This%20is%20a%20good%20message!%20%7BCOMPANY_ADDRESS%7D&recipients%5Blist%5D=46
76
- body:
77
- headers:
78
- accept:
75
+ uri: https://api.emailcampaigns.net:443/2/REST/?campaignName=factory%20campaign&key=%{API_KEY}&method=Campaign_Create_Standard&senderEmail=nate@envylabs.com&senderName=Nate%20Bibler&subject=Factory%20Campaign%20Message&content%5Btext%5D=This%20is%20a%20good%20message!%20%7BCOMPANY_ADDRESS%7D&recipients%5Blist%5D=57
76
+ body: !!null
77
+ headers:
78
+ accept:
79
79
  - application/json
80
- user-agent:
81
- - contactology/0.0.1 (Rubygems; Ruby 1.9.2 x86_64-darwin10.7.1)
82
- response: !ruby/struct:VCR::Response
83
- status: !ruby/struct:VCR::ResponseStatus
80
+ user-agent:
81
+ - contactology/0.0.1 (Rubygems; Ruby 1.9.2 x86_64-darwin10.8.0)
82
+ response: !ruby/struct:VCR::Response
83
+ status: !ruby/struct:VCR::ResponseStatus
84
84
  code: 200
85
85
  message: OK
86
- headers:
87
- x-powered-by:
86
+ headers:
87
+ x-powered-by:
88
88
  - PHP/5.2.10
89
- set-cookie:
90
- - PHPSESSID=3b70f5bce9c49f9029c6ff3472b58274; path=/
91
- expires:
89
+ set-cookie:
90
+ - PHPSESSID=24befcb3d91865ee60c2babd985e22f0; path=/
91
+ expires:
92
92
  - Thu, 19 Nov 1981 08:52:00 GMT
93
- cache-control:
93
+ cache-control:
94
94
  - no-store, no-cache, must-revalidate, post-check=0, pre-check=0
95
- pragma:
95
+ pragma:
96
96
  - no-cache
97
- content-type:
97
+ content-type:
98
98
  - text/plain;charset=UTF-8
99
- transfer-encoding:
99
+ transfer-encoding:
100
100
  - chunked
101
- date:
102
- - Wed, 03 Aug 2011 18:23:58 GMT
103
- server:
101
+ date:
102
+ - Thu, 04 Aug 2011 02:38:48 GMT
103
+ server:
104
104
  - lighttpd/1.4.28
105
- body: "33"
106
- http_version: "1.1"
107
- - !ruby/struct:VCR::HTTPInteraction
108
- request: !ruby/struct:VCR::Request
105
+ body: '49'
106
+ http_version: '1.1'
107
+ - !ruby/struct:VCR::HTTPInteraction
108
+ request: !ruby/struct:VCR::Request
109
109
  method: :get
110
- uri: https://api.emailcampaigns.net:443/2/REST/?campaignId=33&key=%{API_KEY}&method=Campaign_Get_Info
111
- body:
112
- headers:
113
- accept:
110
+ uri: https://api.emailcampaigns.net:443/2/REST/?campaignId=49&key=%{API_KEY}&method=Campaign_Get_Info
111
+ body: !!null
112
+ headers:
113
+ accept:
114
114
  - application/json
115
- user-agent:
116
- - contactology/0.0.1 (Rubygems; Ruby 1.9.2 x86_64-darwin10.7.1)
117
- response: !ruby/struct:VCR::Response
118
- status: !ruby/struct:VCR::ResponseStatus
115
+ user-agent:
116
+ - contactology/0.0.1 (Rubygems; Ruby 1.9.2 x86_64-darwin10.8.0)
117
+ response: !ruby/struct:VCR::Response
118
+ status: !ruby/struct:VCR::ResponseStatus
119
119
  code: 200
120
120
  message: OK
121
- headers:
122
- x-powered-by:
121
+ headers:
122
+ x-powered-by:
123
123
  - PHP/5.2.10
124
- set-cookie:
125
- - PHPSESSID=f0b1859e137c96c71fa9dacdf108536e; path=/
126
- expires:
124
+ set-cookie:
125
+ - PHPSESSID=f5497edf3ec9b967c0151e4895e28ef2; path=/
126
+ expires:
127
127
  - Thu, 19 Nov 1981 08:52:00 GMT
128
- cache-control:
128
+ cache-control:
129
129
  - no-store, no-cache, must-revalidate, post-check=0, pre-check=0
130
- pragma:
130
+ pragma:
131
131
  - no-cache
132
- content-type:
132
+ content-type:
133
133
  - text/plain;charset=UTF-8
134
- transfer-encoding:
134
+ transfer-encoding:
135
135
  - chunked
136
- date:
137
- - Wed, 03 Aug 2011 18:23:59 GMT
138
- server:
136
+ date:
137
+ - Thu, 04 Aug 2011 02:38:49 GMT
138
+ server:
139
139
  - lighttpd/1.4.28
140
- body: "{\"campaignId\":\"33\",\"campaignName\":\"factory campaign\",\"type\":\"standard\",\"contentType\":\"standard\",\"status\":\"draft\",\"recipients\":{\"list\":[\"46\"]},\"subject\":\"Factory Campaign Message\",\"senderName\":\"Nate Bibler\",\"senderEmail\":\"nate@envylabs.com\",\"recipientName\":\"\",\"replyToName\":\"\",\"replyToEmail\":null,\"content\":{\"html\":\"\",\"text\":\"This is a good message! {COMPANY_ADDRESS}\"},\"startTime\":\"2011-08-03 18:23:58\",\"authenticate\":false,\"trackReplies\":false,\"showInArchive\":false,\"viewInBrowser\":false,\"trackOpens\":true,\"trackClickThruHTML\":true,\"trackClickThruText\":true,\"googleAnalyticsName\":null,\"automaticTweet\":false,\"clickTaleName\":null,\"clickTaleCustomFields\":[\"\"],\"useCustomUrlParameters\":null,\"customUrlParameters\":null}"
141
- http_version: "1.1"
142
- - !ruby/struct:VCR::HTTPInteraction
143
- request: !ruby/struct:VCR::Request
140
+ body: ! '{"campaignId":"49","campaignName":"factory campaign","type":"standard","contentType":"standard","status":"draft","recipients":{"list":["57"]},"subject":"Factory
141
+ Campaign Message","senderName":"Nate Bibler","senderEmail":"nate@envylabs.com","recipientName":"","replyToName":"","replyToEmail":null,"content":{"html":"","text":"This
142
+ is a good message! {COMPANY_ADDRESS}"},"startTime":"2011-08-04 02:38:48","authenticate":false,"trackReplies":false,"showInArchive":false,"viewInBrowser":false,"trackOpens":true,"trackClickThruHTML":true,"trackClickThruText":true,"googleAnalyticsName":null,"automaticTweet":false,"clickTaleName":null,"clickTaleCustomFields":[""],"useCustomUrlParameters":null,"customUrlParameters":null}'
143
+ http_version: '1.1'
144
+ - !ruby/struct:VCR::HTTPInteraction
145
+ request: !ruby/struct:VCR::Request
144
146
  method: :get
145
- uri: https://api.emailcampaigns.net:443/2/REST/?key=%{API_KEY}&listId=46&method=List_Delete
146
- body:
147
- headers:
148
- accept:
147
+ uri: https://api.emailcampaigns.net:443/2/REST/?campaignId=49&key=%{API_KEY}&method=Campaign_Delete
148
+ body: !!null
149
+ headers:
150
+ accept:
149
151
  - application/json
150
- user-agent:
151
- - contactology/0.0.1 (Rubygems; Ruby 1.9.2 x86_64-darwin10.7.1)
152
- response: !ruby/struct:VCR::Response
153
- status: !ruby/struct:VCR::ResponseStatus
152
+ user-agent:
153
+ - contactology/0.0.1 (Rubygems; Ruby 1.9.2 x86_64-darwin10.8.0)
154
+ response: !ruby/struct:VCR::Response
155
+ status: !ruby/struct:VCR::ResponseStatus
154
156
  code: 200
155
157
  message: OK
156
- headers:
157
- x-powered-by:
158
+ headers:
159
+ x-powered-by:
158
160
  - PHP/5.2.10
159
- set-cookie:
160
- - PHPSESSID=84399ae8907f376ee7017cb061cb3b3f; path=/
161
- expires:
161
+ set-cookie:
162
+ - PHPSESSID=dd081190a0c5ba1fa334956b95b1bba8; path=/
163
+ expires:
162
164
  - Thu, 19 Nov 1981 08:52:00 GMT
163
- cache-control:
165
+ cache-control:
164
166
  - no-store, no-cache, must-revalidate, post-check=0, pre-check=0
165
- pragma:
167
+ pragma:
166
168
  - no-cache
167
- content-type:
169
+ content-type:
168
170
  - text/plain;charset=UTF-8
169
- transfer-encoding:
171
+ transfer-encoding:
170
172
  - chunked
171
- date:
172
- - Wed, 03 Aug 2011 18:24:00 GMT
173
- server:
173
+ date:
174
+ - Thu, 04 Aug 2011 02:38:49 GMT
175
+ server:
174
176
  - lighttpd/1.4.28
175
- body: "true"
176
- http_version: "1.1"
177
- - !ruby/struct:VCR::HTTPInteraction
178
- request: !ruby/struct:VCR::Request
177
+ body: 'true'
178
+ http_version: '1.1'
179
+ - !ruby/struct:VCR::HTTPInteraction
180
+ request: !ruby/struct:VCR::Request
179
181
  method: :get
180
- uri: https://api.emailcampaigns.net:443/2/REST/?campaignId=33&key=%{API_KEY}&method=Campaign_Delete
181
- body:
182
- headers:
183
- accept:
182
+ uri: https://api.emailcampaigns.net:443/2/REST/?campaignId=49&key=%{API_KEY}&method=Campaign_Get_Info
183
+ body: !!null
184
+ headers:
185
+ accept:
184
186
  - application/json
185
- user-agent:
186
- - contactology/0.0.1 (Rubygems; Ruby 1.9.2 x86_64-darwin10.7.1)
187
- response: !ruby/struct:VCR::Response
188
- status: !ruby/struct:VCR::ResponseStatus
187
+ user-agent:
188
+ - contactology/0.0.1 (Rubygems; Ruby 1.9.2 x86_64-darwin10.8.0)
189
+ response: !ruby/struct:VCR::Response
190
+ status: !ruby/struct:VCR::ResponseStatus
189
191
  code: 200
190
192
  message: OK
191
- headers:
192
- x-powered-by:
193
+ headers:
194
+ x-powered-by:
193
195
  - PHP/5.2.10
194
- set-cookie:
195
- - PHPSESSID=fb7cd68453b20088187ed9db9ef0a4ff; path=/
196
- expires:
196
+ set-cookie:
197
+ - PHPSESSID=ab6ba24d376779e315a7801139c2c492; path=/
198
+ expires:
197
199
  - Thu, 19 Nov 1981 08:52:00 GMT
198
- cache-control:
200
+ cache-control:
199
201
  - no-store, no-cache, must-revalidate, post-check=0, pre-check=0
200
- pragma:
202
+ pragma:
201
203
  - no-cache
202
- content-type:
204
+ content-type:
203
205
  - text/plain;charset=UTF-8
204
- transfer-encoding:
206
+ transfer-encoding:
205
207
  - chunked
206
- date:
207
- - Wed, 03 Aug 2011 18:24:00 GMT
208
- server:
208
+ date:
209
+ - Thu, 04 Aug 2011 02:38:50 GMT
210
+ server:
209
211
  - lighttpd/1.4.28
210
- body: "true"
211
- http_version: "1.1"
212
- - !ruby/struct:VCR::HTTPInteraction
213
- request: !ruby/struct:VCR::Request
212
+ body: ! '{"result":"error","message":"Input Error: campaignId 49 not found","code":601}'
213
+ http_version: '1.1'
214
+ - !ruby/struct:VCR::HTTPInteraction
215
+ request: !ruby/struct:VCR::Request
214
216
  method: :get
215
- uri: https://api.emailcampaigns.net:443/2/REST/?campaignId=33&key=%{API_KEY}&method=Campaign_Get_Info
216
- body:
217
- headers:
218
- accept:
217
+ uri: https://api.emailcampaigns.net:443/2/REST/?key=%{API_KEY}&listId=57&method=List_Delete
218
+ body: !!null
219
+ headers:
220
+ accept:
219
221
  - application/json
220
- user-agent:
221
- - contactology/0.0.1 (Rubygems; Ruby 1.9.2 x86_64-darwin10.7.1)
222
- response: !ruby/struct:VCR::Response
223
- status: !ruby/struct:VCR::ResponseStatus
222
+ user-agent:
223
+ - contactology/0.0.1 (Rubygems; Ruby 1.9.2 x86_64-darwin10.8.0)
224
+ response: !ruby/struct:VCR::Response
225
+ status: !ruby/struct:VCR::ResponseStatus
224
226
  code: 200
225
227
  message: OK
226
- headers:
227
- x-powered-by:
228
+ headers:
229
+ x-powered-by:
228
230
  - PHP/5.2.10
229
- set-cookie:
230
- - PHPSESSID=518ac479af356a6ffd117517bb197180; path=/
231
- expires:
231
+ set-cookie:
232
+ - PHPSESSID=42601b1b60dbde7b4fa5d4aa177f3bbd; path=/
233
+ expires:
232
234
  - Thu, 19 Nov 1981 08:52:00 GMT
233
- cache-control:
235
+ cache-control:
234
236
  - no-store, no-cache, must-revalidate, post-check=0, pre-check=0
235
- pragma:
237
+ pragma:
236
238
  - no-cache
237
- content-type:
239
+ content-type:
238
240
  - text/plain;charset=UTF-8
239
- transfer-encoding:
241
+ transfer-encoding:
240
242
  - chunked
241
- date:
242
- - Wed, 03 Aug 2011 18:24:01 GMT
243
- server:
243
+ date:
244
+ - Thu, 04 Aug 2011 02:38:50 GMT
245
+ server:
244
246
  - lighttpd/1.4.28
245
- body: "{\"result\":\"error\",\"message\":\"Input Error: campaignId 33 not found\",\"code\":601}"
246
- http_version: "1.1"
247
+ body: 'true'
248
+ http_version: '1.1'