Module: Convertkit::Client::Subscribers
- Included in:
- Convertkit::Client
- Defined in:
- lib/convertkit/client/subscribers.rb
Instance Method Summary collapse
- #remove_tag_from_subscriber(subscriber_id, tag_id) ⇒ Object
- #subscriber(subscriber_id) ⇒ Object
- #subscriber_tags(subscriber_id) ⇒ Object
- #subscribers(options = {}) ⇒ Object
- #unsubscribe(email) ⇒ Object
- #update_subscriber(subscriber_id, options = {}) ⇒ Object
Instance Method Details
#remove_tag_from_subscriber(subscriber_id, tag_id) ⇒ Object
31 32 33 |
# File 'lib/convertkit/client/subscribers.rb', line 31 def remove_tag_from_subscriber(subscriber_id, tag_id) connection.delete("subscribers/#{subscriber_id}/tags/#{tag_id}") end |
#subscriber(subscriber_id) ⇒ Object
8 9 10 |
# File 'lib/convertkit/client/subscribers.rb', line 8 def subscriber(subscriber_id) connection.get("subscribers/#{subscriber_id}") end |
#subscriber_tags(subscriber_id) ⇒ Object
12 13 14 |
# File 'lib/convertkit/client/subscribers.rb', line 12 def (subscriber_id) connection.get("subscribers/#{subscriber_id}/tags") end |
#subscribers(options = {}) ⇒ Object
4 5 6 |
# File 'lib/convertkit/client/subscribers.rb', line 4 def subscribers( = {}) connection.get("subscribers", ) end |
#unsubscribe(email) ⇒ Object
25 26 27 28 29 |
# File 'lib/convertkit/client/subscribers.rb', line 25 def unsubscribe(email) connection.put("unsubscribe") do |f| f.params['email'] = email end end |
#update_subscriber(subscriber_id, options = {}) ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/convertkit/client/subscribers.rb', line 16 def update_subscriber(subscriber_id, = {}) response = connection.put("subscribers/#{subscriber_id}") do |f| f.params["email_address"] = [:email_address] if [:email_address] f.params["fields"] = [:fields] if [:fields] f.params["first_name"] = [:first_name] if [:first_name] end response.body end |