lib/createsend/client.rb in createsend-5.1.1 vs lib/createsend/client.rb in createsend-6.0.0
- old
+ new
@@ -23,13 +23,23 @@
response = cs_get "/clients/#{client_id}.json", {}
Hashie::Mash.new(response)
end
# Gets the sent campaigns belonging to this client.
- def campaigns
- response = get 'campaigns'
- response.map{|item| Hashie::Mash.new(item)}
+ def campaigns(page=1, page_size=1000, order_direction="desc",
+ sent_from_date='', sent_to_date='', tags='')
+ options = { :query => {
+ :page => page,
+ :pagesize => page_size,
+ :orderdirection => order_direction,
+ :sentfromdate => sent_from_date,
+ :senttodate => sent_to_date,
+ :tags => tags
+ }}
+
+ response = get 'campaigns', options
+ Hashie::Mash.new(response)
end
# Gets the currently scheduled campaigns belonging to this client.
def scheduled
response = get 'scheduled'
@@ -37,9 +47,15 @@
end
# Gets the draft campaigns belonging to this client.
def drafts
response = get 'drafts'
+ response.map{|item| Hashie::Mash.new(item)}
+ end
+
+ # Gets all the tags belonging to this client.
+ def tags
+ response = get 'tags'
response.map{|item| Hashie::Mash.new(item)}
end
# Gets the subscriber lists belonging to this client.
def lists
\ No newline at end of file