klaviyo 2.0.2 → 2.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/klaviyo.gemspec +2 -2
- data/lib/klaviyo/apis/campaigns.rb +41 -0
- data/lib/klaviyo/klaviyo_module.rb +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 438fe72ddfdd5e636f8026c8e0b02daf22586e58c4a2628065db088b633bb1be
|
4
|
+
data.tar.gz: c586d57114a208aa6843fa6dd218d2e2ceae454282c8b4b297a7ab122cd89dd3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bce5653e39bc762647ee52f29a3c0b2d8ea672b782a5192e9ca3d3da11a41e388f67a5c11f7eb28ce7f274f691a445677ee345eb3855ba2fa422ed30407a282f
|
7
|
+
data.tar.gz: 5f831ad7a264a16b697435e1cafe6c942f7c58572bdf67041d74b3f65f398fd4ba948e0c70edbccb6d5839d16f0831553ce2868fe43b6b6fe796d9dfef2e2103
|
data/klaviyo.gemspec
CHANGED
@@ -2,8 +2,8 @@ files = ['klaviyo.gemspec', '{lib}/**/**/*'].map {|f| Dir[f]}.flatten
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = 'klaviyo'
|
5
|
-
s.version = '2.0.
|
6
|
-
s.date = '
|
5
|
+
s.version = '2.0.3'
|
6
|
+
s.date = '2021-01-11'
|
7
7
|
s.summary = 'You heard us, a Ruby wrapper for the Klaviyo API'
|
8
8
|
s.description = 'Ruby wrapper for the Klaviyo API'
|
9
9
|
s.authors = ['Klaviyo Team']
|
@@ -0,0 +1,41 @@
|
|
1
|
+
module Klaviyo
|
2
|
+
class Campaigns < Client
|
3
|
+
CANCEL = 'cancel'
|
4
|
+
CAMPAIGN = 'campaign'
|
5
|
+
CAMPAIGNS = 'campaigns'
|
6
|
+
SEND = 'send'
|
7
|
+
|
8
|
+
# Retrieves all the campaigns from Klaviyo account
|
9
|
+
# @return [List] of JSON formatted campaing objects
|
10
|
+
def self.get_campaigns()
|
11
|
+
v1_request(HTTP_GET, CAMPAIGNS)
|
12
|
+
end
|
13
|
+
|
14
|
+
# Retrieves the details of the list
|
15
|
+
# @param campaign_id the if of campaign
|
16
|
+
# @return [JSON] a JSON object containing information about the campaign
|
17
|
+
def self.get_campaign_details(campaign_id)
|
18
|
+
path = "#{CAMPAIGN}/#{campaign_id}"
|
19
|
+
|
20
|
+
v1_request(HTTP_GET, path)
|
21
|
+
end
|
22
|
+
|
23
|
+
# Sends the campaign immediately
|
24
|
+
# @param campaign_id [String] the id of campaign
|
25
|
+
# @return will return with HTTP ok in case of success
|
26
|
+
def self.send_campaign(campaign_id)
|
27
|
+
path = "#{CAMPAIGN}/#{campaign_id}/#{SEND}"
|
28
|
+
|
29
|
+
v1_request(HTTP_POST, path)
|
30
|
+
end
|
31
|
+
|
32
|
+
# Cancels the campaign with specified campaign_id
|
33
|
+
# @param campaign_id [String] the id of campaign
|
34
|
+
# @return [JSON] a JSON object containing the campaign details
|
35
|
+
def self.cancel_campaign(campaign_id)
|
36
|
+
path = "#{CAMPAIGN}/#{campaign_id}/#{CANCEL}"
|
37
|
+
|
38
|
+
v1_request(HTTP_POST, path)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: klaviyo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Klaviyo Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -74,6 +74,7 @@ extra_rdoc_files: []
|
|
74
74
|
files:
|
75
75
|
- klaviyo.gemspec
|
76
76
|
- lib/klaviyo.rb
|
77
|
+
- lib/klaviyo/apis/campaigns.rb
|
77
78
|
- lib/klaviyo/apis/lists.rb
|
78
79
|
- lib/klaviyo/apis/metrics.rb
|
79
80
|
- lib/klaviyo/apis/profiles.rb
|