createsend 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- createsend (1.1.0)
4
+ createsend (1.1.1)
5
5
  hashie (~> 1.0)
6
6
  httparty (~> 0.8)
7
7
  json
@@ -20,22 +20,24 @@ module CreateSend
20
20
  end
21
21
 
22
22
  # Adds a subscriber to a subscriber list.
23
- def self.add(list_id, email_address, name, custom_fields, resubscribe)
23
+ def self.add(list_id, email_address, name, custom_fields, resubscribe, restart_subscription_based_autoresponders=false)
24
24
  options = { :body => {
25
25
  :EmailAddress => email_address,
26
26
  :Name => name,
27
27
  :CustomFields => custom_fields,
28
- :Resubscribe => resubscribe }.to_json }
28
+ :Resubscribe => resubscribe,
29
+ :RestartSubscriptionBasedAutoresponders => restart_subscription_based_autoresponders }.to_json }
29
30
  response = CreateSend.post "/subscribers/#{list_id}.json", options
30
31
  response.parsed_response
31
32
  end
32
33
 
33
34
  # Imports subscribers into a subscriber list.
34
- def self.import(list_id, subscribers, resubscribe, queue_subscription_based_autoresponders=false)
35
+ def self.import(list_id, subscribers, resubscribe, queue_subscription_based_autoresponders=false, restart_subscription_based_autoresponders=false)
35
36
  options = { :body => {
36
37
  :Subscribers => subscribers,
37
38
  :Resubscribe => resubscribe,
38
- :QueueSubscriptionBasedAutoresponders => queue_subscription_based_autoresponders }.to_json }
39
+ :QueueSubscriptionBasedAutoresponders => queue_subscription_based_autoresponders,
40
+ :RestartSubscriptionBasedAutoresponders => restart_subscription_based_autoresponders }.to_json }
39
41
  begin
40
42
  response = CreateSend.post "/subscribers/#{list_id}/import.json", options
41
43
  rescue BadRequest => br
@@ -54,14 +56,15 @@ module CreateSend
54
56
 
55
57
  # Updates any aspect of a subscriber, including email address, name, and
56
58
  # custom field data if supplied.
57
- def update(new_email_address, name, custom_fields, resubscribe)
59
+ def update(new_email_address, name, custom_fields, resubscribe, restart_subscription_based_autoresponders=false)
58
60
  options = {
59
61
  :query => { :email => @email_address },
60
62
  :body => {
61
63
  :EmailAddress => new_email_address,
62
64
  :Name => name,
63
65
  :CustomFields => custom_fields,
64
- :Resubscribe => resubscribe }.to_json }
66
+ :Resubscribe => resubscribe,
67
+ :RestartSubscriptionBasedAutoresponders => restart_subscription_based_autoresponders }.to_json }
65
68
  CreateSend.put "/subscribers/#{@list_id}.json", options
66
69
  # Update @email_address, so this object can continue to be used reliably
67
70
  @email_address = new_email_address
@@ -1,3 +1,3 @@
1
1
  module CreateSend
2
- VERSION = "1.1.0" unless defined?(CreateSend::VERSION)
3
- end
2
+ VERSION = "1.1.1" unless defined?(CreateSend::VERSION)
3
+ end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: createsend
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.1.0
5
+ version: 1.1.1
6
6
  platform: ruby
7
7
  authors:
8
8
  - James Dennes
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2012-07-11 00:00:00 Z
13
+ date: 2012-08-02 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rake