iterable-api-client 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- checksums.yaml.gz.sig +2 -1
- data.tar.gz.sig +0 -0
- data/README.md +19 -1
- data/bin/console +14 -0
- data/lib/iterable/email.rb +15 -0
- metadata +4 -3
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 4506c996979cb9df87929946898bd6c84f7de779be90190965d962a917b9c588
|
4
|
+
data.tar.gz: 9ba69e4096a6eaf62eb243eca90b0369c35d6f2fcbf7728f4a0df89aef911a4d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4ec86d3bc2f892914c393e8bcc01f84cb533ca32206281dd771123282fe650f48e62394905bf0c32ae0643098cf7a466fe81843c928b83e9b9e711a78fcec97e
|
7
|
+
data.tar.gz: 6e8319780483c79d4f158763832ad8e84776fbd51a0a37a81c2dbb642524799ce2b4096cfdcb3a76d284214e66fb4f1d26ca7c5cacdc6c0f952732aefe9c03b8
|
checksums.yaml.gz.sig
CHANGED
@@ -1 +1,2 @@
|
|
1
|
-
|
1
|
+
~>G���zp+
|
2
|
+
��i���-��.���~���C">�S�.q?�M� �������m�5R�����;�p5T'���]@�&d���ps�$�_=Њ�'ƅ��6Ɵ�I?]�mR��om������ݗ����k�.��K_���([xr��\����E���}{zV^F�N8���~UH`oj�L�:md���~�fxph�����!��L���{/�V�!�: P%�� ᆪr��]���
|
data.tar.gz.sig
CHANGED
Binary file
|
data/README.md
CHANGED
@@ -6,6 +6,8 @@
|
|
6
6
|
|
7
7
|
Rubygem to interact with the [Iterable][iterable] API.
|
8
8
|
|
9
|
+
[Source code][source] on [Gitlab].
|
10
|
+
|
9
11
|
## Installation
|
10
12
|
|
11
13
|
```ruby
|
@@ -99,6 +101,7 @@ reponse.uri
|
|
99
101
|
* [Register Device Token](#device-register-token)
|
100
102
|
* [Email](#email)
|
101
103
|
* [View](#email-view)
|
104
|
+
* [Target](#email-target)
|
102
105
|
* [Email Templates](#email-templates)
|
103
106
|
* [Get](#email-templates-get)
|
104
107
|
* [Update](#email-templates-update)
|
@@ -188,7 +191,7 @@ start_time = end_time - (60 * 60* 24 * 7) # 7 days ago
|
|
188
191
|
response = campaigns.metrics campaign_ids, start_time, end_time
|
189
192
|
```
|
190
193
|
|
191
|
-
#### Campaigns
|
194
|
+
#### Campaigns Recurring
|
192
195
|
|
193
196
|
Endpoint: `GET /campaigns/recurring/{id}/childCampaigns`
|
194
197
|
|
@@ -277,6 +280,19 @@ email = Iterable::Email.new
|
|
277
280
|
response = email.view 'user@example.com', 'message-id'
|
278
281
|
```
|
279
282
|
|
283
|
+
#### Email Target
|
284
|
+
|
285
|
+
Endpoint: `GET /email/target`
|
286
|
+
|
287
|
+
```ruby
|
288
|
+
email = Iterable::Email.new
|
289
|
+
# User email and campaign to target
|
290
|
+
response = email.target 'user@example.com', 42
|
291
|
+
|
292
|
+
# Can pass in more attributes like dataFields
|
293
|
+
response = email.target 'user@example.com', 42, { dataFields: { first_name: 'Sally' } }
|
294
|
+
```
|
295
|
+
|
280
296
|
### Email Templates
|
281
297
|
|
282
298
|
#### Email Templates Get
|
@@ -743,4 +759,6 @@ response = workflows.trigger 'workflow-id', attrs
|
|
743
759
|
|
744
760
|
[api-docs]: https://api.iterable.com/api/docs
|
745
761
|
[docs]: http://www.rubydoc.info/gems/iterable-api-client
|
762
|
+
[gitlab]: https://gitlab.com
|
746
763
|
[iterable]: https://iterable.com
|
764
|
+
[source]: https://gitlab.com/mtchavez/iterable
|
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'bundler/setup'
|
4
|
+
require 'iterable-api-client'
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require 'irb'
|
14
|
+
IRB.start(__FILE__)
|
data/lib/iterable/email.rb
CHANGED
@@ -24,5 +24,20 @@ module Iterable
|
|
24
24
|
params = { email: email, messageId: message_id }
|
25
25
|
Iterable.request(conf, '/email/viewInBrowser', params).get
|
26
26
|
end
|
27
|
+
|
28
|
+
##
|
29
|
+
#
|
30
|
+
# Target a user with an email given a campaign
|
31
|
+
#
|
32
|
+
# @param email [String] Email of user who received the message to view
|
33
|
+
# @param campaign_id [Integer] Campaign id to target user for
|
34
|
+
# @param attrs [Hash] Hash of attributes to pass like dataFields with the request
|
35
|
+
#
|
36
|
+
# @return [Iterable::Response] A response object
|
37
|
+
def target(email, campaign_id, attrs = {})
|
38
|
+
attrs[:recipientEmail] = email
|
39
|
+
attrs[:campaignId] = campaign_id
|
40
|
+
Iterable.request(conf, '/email/target').post(attrs)
|
41
|
+
end
|
27
42
|
end
|
28
43
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: iterable-api-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chavez
|
@@ -30,7 +30,7 @@ cert_chain:
|
|
30
30
|
Gyzp8WFLv1yPdHyGqulJLNTeTrX6l88VkaUp438wtcWQoM+Qpuf4m8tEyVDmkhQz
|
31
31
|
322/Jzl3jLNyDSMXzBnKNIkLVYY5ifp7cropxQ==
|
32
32
|
-----END CERTIFICATE-----
|
33
|
-
date:
|
33
|
+
date: 2018-07-17 00:00:00.000000000 Z
|
34
34
|
dependencies:
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
36
|
name: multi_json
|
@@ -278,6 +278,7 @@ extra_rdoc_files:
|
|
278
278
|
- README.md
|
279
279
|
files:
|
280
280
|
- README.md
|
281
|
+
- bin/console
|
281
282
|
- lib/iterable-api-client.rb
|
282
283
|
- lib/iterable.rb
|
283
284
|
- lib/iterable/api_resource.rb
|
@@ -326,7 +327,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
326
327
|
version: '0'
|
327
328
|
requirements: []
|
328
329
|
rubyforge_project:
|
329
|
-
rubygems_version: 2.6
|
330
|
+
rubygems_version: 2.7.6
|
330
331
|
signing_key:
|
331
332
|
specification_version: 4
|
332
333
|
summary: Iterable REST API Client
|
metadata.gz.sig
CHANGED
Binary file
|