Module: Drip::Client::Tags

Included in:
Drip::Client
Defined in:
lib/drip/client/tags.rb

Instance Method Summary collapse

Instance Method Details

#apply_tag(email, tag) ⇒ Object

Public: Apply a tag to a subscriber.

email - The String email address of the subscriber. tag - The String tag to apply.

Returns a Drip::Response. See www.getdrip.com/docs/rest-api#apply_tag



23
24
25
26
# File 'lib/drip/client/tags.rb', line 23

def apply_tag(email, tag)
  data = { "email" => email, "tag" => tag }
  make_json_api_request :post, "v2/#{}/tags", private_generate_resource("tags", data)
end

#remove_tag(email, tag) ⇒ Object

Public: Remove a tag from a subscriber.

email - The String email address of the subscriber. tag - The String tag to remove.

Returns a Drip::Response. See www.getdrip.com/docs/rest-api#remove_tag



35
36
37
# File 'lib/drip/client/tags.rb', line 35

def remove_tag(email, tag)
  make_json_api_request :delete, "v2/#{}/subscribers/#{CGI.escape email}/tags/#{CGI.escape tag}"
end

#tagsObject

Public: Get all tags for the account.

Returns a Drip::Response. See www.getdrip.com/docs/rest-api#tags



12
13
14
# File 'lib/drip/client/tags.rb', line 12

def tags
  make_json_api_request :get, "v2/#{}/tags"
end