Class: Iterable::Push
- Inherits:
-
ApiResource
- Object
- ApiResource
- Iterable::Push
- Defined in:
- lib/iterable/push.rb
Overview
Interact with /push API endpoints
Instance Attribute Summary
Attributes inherited from ApiResource
Instance Method Summary collapse
-
#cancel(email: nil, campaign_id: nil, attrs: {}) ⇒ Iterable::Response
Cancel a push notification to a specific user Must include either an email address AND campaignId, or just a scheduledMessageId provided in the attrs.
-
#target(campaign_id:, email: nil, attrs: {}) ⇒ Iterable::Response
Send a push notification to a specific user.
Methods inherited from ApiResource
#default_config, default_config, #initialize
Constructor Details
This class inherits a constructor from Iterable::ApiResource
Instance Method Details
permalink #cancel(email: nil, campaign_id: nil, attrs: {}) ⇒ Iterable::Response
Note:
An email or UserId is required
Cancel a push notification to a specific user Must include either an email address AND campaignId, or just a scheduledMessageId provided in the attrs
40 41 42 43 44 |
# File 'lib/iterable/push.rb', line 40 def cancel(email: nil, campaign_id: nil, attrs: {}) attrs['email'] = email if email attrs['campaignId'] = campaign_id if campaign_id Iterable.request(conf, '/push/cancel').post(attrs) end |
permalink #target(campaign_id:, email: nil, attrs: {}) ⇒ Iterable::Response
Send a push notification to a specific user
21 22 23 24 25 |
# File 'lib/iterable/push.rb', line 21 def target(campaign_id:, email: nil, attrs: {}) attrs['recipientEmail'] = email if email attrs['campaignId'] = campaign_id Iterable.request(conf, '/push/target').post(attrs) end |