lib/createsend/subscriber.rb in createsend-1.0.1 vs lib/createsend/subscriber.rb in createsend-1.0.2
- old
+ new
@@ -29,14 +29,15 @@
response = CreateSend.post "/subscribers/#{list_id}.json", options
response.parsed_response
end
# Imports subscribers into a subscriber list.
- def self.import(list_id, subscribers, resubscribe)
+ def self.import(list_id, subscribers, resubscribe, queue_subscription_based_autoresponders=false)
options = { :body => {
:Subscribers => subscribers,
- :Resubscribe => resubscribe }.to_json }
+ :Resubscribe => resubscribe,
+ :QueueSubscriptionBasedAutoresponders => queue_subscription_based_autoresponders }.to_json }
begin
response = CreateSend.post "/subscribers/#{list_id}/import.json", options
rescue BadRequest => br
# Subscriber import will throw BadRequest if some subscribers are not imported
# successfully. If this occurs, we want to return the ResultData property of
@@ -78,7 +79,12 @@
options = { :query => { :email => @email_address } }
response = CreateSend.get "/subscribers/#{@list_id}/history.json", options
response.map{|item| Hashie::Mash.new(item)}
end
+ # Moves this subscriber to the Deleted state in the associated list.
+ def delete
+ options = { :query => { :email => @email_address } }
+ CreateSend.delete "/subscribers/#{@list_id}.json", options
+ end
end
end
\ No newline at end of file