mixmax 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/mixmax.rb +41 -8
- data/lib/mixmax/version.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 35620c083cb524d5d57c0605b0ef100077d65f3d2a7cdfa03a2f6b97c6881299
|
4
|
+
data.tar.gz: 2c0c7c7d472a69177739f8fa52826f0c978b64a9773b9313bdf9b87e892e6650
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b031431be57900a60c2bdf0b9a0ce2de18ea834732cdccb60e05d2af2ff98751a6fe93de53eba0ec333887adbad193afa75004ba5d510efcc8317bebbb3cc327
|
7
|
+
data.tar.gz: 82a26897e4c305d517f0461cf309892c47575fab6f643986e2c64fed582b0cc1153d5b588948c758012d4fa65dc866a522d46456ebb7f5fcf8211219c2507740
|
data/Gemfile.lock
CHANGED
data/lib/mixmax.rb
CHANGED
@@ -1,20 +1,53 @@
|
|
1
|
-
|
1
|
+
require_relative "mixmax/version"
|
2
2
|
require "httparty"
|
3
3
|
|
4
|
-
|
4
|
+
class Mixmax
|
5
5
|
include HTTParty
|
6
|
+
|
7
|
+
def initialize(api_key)
|
8
|
+
@headers = { "X-API-Token" => api_key}
|
9
|
+
end
|
10
|
+
|
6
11
|
base_uri "api.mixmax.com"
|
7
|
-
# api_key = '90aa4d9c-53a0-41a8-860e-7a995a9a2f4e'
|
8
|
-
# headers = {
|
9
|
-
# "X-API-Token" => api_key
|
10
|
-
# }
|
11
12
|
|
13
|
+
def sequences
|
14
|
+
self.class.get("/v1/sequences", headers: @headers).parsed_response["results"]
|
15
|
+
end
|
12
16
|
|
13
|
-
def
|
14
|
-
get("/v1/sequences", :headers
|
17
|
+
def sequence_recipients(id)
|
18
|
+
self.class.get("/v1/sequences/#{id}", headers: @headers)
|
19
|
+
end
|
20
|
+
|
21
|
+
def add_to_sequence(id, recipients)
|
22
|
+
self.class.post("/v1/sequences/#{id}/recipients", headers: @headers, body: recipients)
|
15
23
|
end
|
16
24
|
end
|
17
25
|
|
18
26
|
|
19
27
|
# Mixmax.add_to_sequence(id, recipients)
|
20
28
|
# Mixmax.sequences
|
29
|
+
#
|
30
|
+
# curl -XPOST \
|
31
|
+
# --header 'Content-Type: application/json' \
|
32
|
+
# --header "X-API-Token: <your token>" \
|
33
|
+
# https://api.mixmax.com/v1/sequences/593HF9J3IJ4JF30IF/recipients \
|
34
|
+
# -d '{
|
35
|
+
# "recipients": [{
|
36
|
+
# "email": "hello@mixmax.com",
|
37
|
+
# "variables": {
|
38
|
+
# "name": "Hugo Brockman",
|
39
|
+
# "email": "hello@mixmax.com"
|
40
|
+
# }
|
41
|
+
# },
|
42
|
+
# {
|
43
|
+
# "email": "careers@mixmax.com",
|
44
|
+
# "variables": {
|
45
|
+
# "name": "Mixmax hello",
|
46
|
+
# "email": "careers@mixmax.com"
|
47
|
+
# }
|
48
|
+
# }],
|
49
|
+
# "scheduledAt": 1490300970312
|
50
|
+
# }'
|
51
|
+
#
|
52
|
+
|
53
|
+
# '{ "recipients": [{ "email": "migueltg93@gmail.com", "variables": { "name": "Mickey Mouse", "email": "mickeymouse@mailinator.com" }}], "scheduledAt": 1554404018 }'
|
data/lib/mixmax/version.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
|
2
|
-
VERSION = "0.1.
|
1
|
+
class Mixmax
|
2
|
+
VERSION = "0.1.2"
|
3
3
|
end
|