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
data/createsend.gemspec
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
require 'bundler'
|
2
|
+
require 'bundler/version'
|
3
|
+
|
4
|
+
require File.expand_path('lib/createsend/version')
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.add_runtime_dependency 'json', '>= 1.0'
|
8
|
+
s.add_runtime_dependency 'hashie', '>= 3.0', '< 6'
|
9
|
+
s.add_runtime_dependency 'httparty', '~> 0.14'
|
10
|
+
s.add_development_dependency 'rake', '~> 12.3.3'
|
11
|
+
s.add_development_dependency 'fakeweb', '~> 1.3'
|
12
|
+
s.add_development_dependency 'jnunemaker-matchy', '~> 0.4'
|
13
|
+
s.add_development_dependency 'shoulda-context', '~> 1.2'
|
14
|
+
s.add_development_dependency 'simplecov', '~> 0'
|
15
|
+
s.add_development_dependency 'coveralls', '~> 0'
|
16
|
+
s.add_development_dependency 'test-unit', '~>3.0'
|
17
|
+
s.name = "createsend-sendowlfork"
|
18
|
+
s.author = "James Dennes"
|
19
|
+
s.description = %q{Implements the complete functionality of the Campaign Monitor API.}
|
20
|
+
s.email = ["jdennes@gmail.com"]
|
21
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{|f| File.basename(f)}
|
22
|
+
s.files = `git ls-files`.split("\n")
|
23
|
+
s.homepage = "http://campaignmonitor.github.io/createsend-ruby/"
|
24
|
+
s.require_paths = ["lib"]
|
25
|
+
s.summary = %q{A library which implements the complete functionality of the Campaign Monitor API.}
|
26
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
27
|
+
s.version = CreateSend::VERSION
|
28
|
+
s.platform = Gem::Platform::RUBY
|
29
|
+
s.required_rubygems_version = Gem::Requirement.new('>= 1.3.6') if s.respond_to? :required_rubygems_version=
|
30
|
+
s.licenses = ['MIT']
|
31
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
module CreateSend
|
2
|
+
# Represents an administrator and associated functionality.
|
3
|
+
class Administrator < CreateSend
|
4
|
+
attr_reader :email_address
|
5
|
+
|
6
|
+
def initialize(auth, email_address)
|
7
|
+
@email_address = email_address
|
8
|
+
super
|
9
|
+
end
|
10
|
+
|
11
|
+
# Gets an administrator by email address.
|
12
|
+
def self.get(auth, email_address)
|
13
|
+
options = { :query => { :email => email_address } }
|
14
|
+
cs = CreateSend.new auth
|
15
|
+
response = cs.cs_get "/admins.json", options
|
16
|
+
Hashie::Mash.new(response)
|
17
|
+
end
|
18
|
+
|
19
|
+
# Adds an administrator to the account.
|
20
|
+
def self.add(auth, email_address, name)
|
21
|
+
options = { :body => {
|
22
|
+
:EmailAddress => email_address,
|
23
|
+
:Name => name
|
24
|
+
}.to_json }
|
25
|
+
cs = CreateSend.new auth
|
26
|
+
response = cs.cs_post "/admins.json", options
|
27
|
+
Hashie::Mash.new(response)
|
28
|
+
end
|
29
|
+
|
30
|
+
# Updates the administator details.
|
31
|
+
def update(new_email_address, name)
|
32
|
+
options = {
|
33
|
+
:query => { :email => @email_address },
|
34
|
+
:body => {
|
35
|
+
:EmailAddress => new_email_address,
|
36
|
+
:Name => name
|
37
|
+
}.to_json }
|
38
|
+
put '/admins.json', options
|
39
|
+
# Update @email_address, so this object can continue to be used reliably
|
40
|
+
@email_address = new_email_address
|
41
|
+
end
|
42
|
+
|
43
|
+
# Deletes this administrator from the account.
|
44
|
+
def delete
|
45
|
+
options = { :query => { :email => @email_address } }
|
46
|
+
super '/admins.json', options
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|