Class: Iterable::Events
- Inherits:
-
ApiResource
- Object
- ApiResource
- Iterable::Events
- Defined in:
- lib/iterable/events.rb
Overview
Interact with /events API endpoints
Instance Attribute Summary
Attributes inherited from ApiResource
Instance Method Summary collapse
-
#for_email(email, limit = 30) ⇒ Iterable::Response
Get all events for a user by email.
-
#track(name, email = nil, attrs = {}) ⇒ Iterable::Response
Track an event.
-
#track_push_open(campaign_id, message_id, email, attrs = {}) ⇒ Iterable::Response
Track an event.
Methods inherited from ApiResource
#default_config, default_config, #initialize
Constructor Details
This class inherits a constructor from Iterable::ApiResource
Instance Method Details
#for_email(email, limit = 30) ⇒ Iterable::Response
Get all events for a user by email
23 24 25 |
# File 'lib/iterable/events.rb', line 23 def for_email(email, limit = 30) Iterable.request(conf, "/events/#{email}", limit: limit).get end |
#track(name, email = nil, attrs = {}) ⇒ Iterable::Response
Track an event
36 37 38 39 40 |
# File 'lib/iterable/events.rb', line 36 def track(name, email = nil, attrs = {}) attrs[:eventName] = name attrs[:email] = email Iterable.request(conf, '/events/track').post(attrs) end |
#track_push_open(campaign_id, message_id, email, attrs = {}) ⇒ Iterable::Response
Track an event
52 53 54 55 56 57 |
# File 'lib/iterable/events.rb', line 52 def track_push_open(campaign_id, , email, attrs = {}) attrs[:campaignId] = campaign_id attrs[:messageId] = attrs[:email] = email Iterable.request(conf, '/events/trackPushOpen').post(attrs) end |