maropost_api 0.3.0 → 0.4.0
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/.travis.yml +5 -0
- data/lib/maropost_api.rb +1 -0
- data/lib/maropost_api/client.rb +4 -0
- data/lib/maropost_api/journeys.rb +28 -0
- data/lib/maropost_api/version.rb +1 -1
- data/readme.md +21 -6
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8e52f2fcdf513ba4a8a8a6ca5243b1fc67ca5d09
|
4
|
+
data.tar.gz: b56a5af3403ce595e25dd0d87d75f377c54548c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 02c2cb9f28a1f2049916919a8db91c5cf1aad3a6a8d5315aa4fdf97420956897d73a67e927764fc5bf55abac28e06dd293cbb5aec862f357d05d17d68f3641aa
|
7
|
+
data.tar.gz: e9fee3ed692756f64ed372a602593a0ac862b9ed06edf2a088c18fd7db08a4936521c53cc0aa60941c68b7a0ca51d2ff122c5ca62a3438737d5c50356cf4f49c
|
data/.travis.yml
ADDED
data/lib/maropost_api.rb
CHANGED
data/lib/maropost_api/client.rb
CHANGED
@@ -0,0 +1,28 @@
|
|
1
|
+
module MaropostApi
|
2
|
+
class Journeys
|
3
|
+
def initialize(request:, parser: Parser::EntityParser.new)
|
4
|
+
@request = request
|
5
|
+
@parser = parser
|
6
|
+
end
|
7
|
+
|
8
|
+
def stop(journey_id:, contact_id:)
|
9
|
+
response = @request.put(endpoint: "/journeys/#{journey_id}/stop/#{contact_id}.json")
|
10
|
+
Response.new(response: response, parser: @parser).call
|
11
|
+
end
|
12
|
+
|
13
|
+
def start(journey_id:, contact_id:)
|
14
|
+
response = @request.put(endpoint: "/journeys/#{journey_id}/start/#{contact_id}.json")
|
15
|
+
Response.new(response: response, parser: @parser).call
|
16
|
+
end
|
17
|
+
|
18
|
+
def reset(journey_id:, contact_id:)
|
19
|
+
response = @request.put(endpoint: "/journeys/#{journey_id}/reset/#{contact_id}.json")
|
20
|
+
Response.new(response: response, parser: @parser).call
|
21
|
+
end
|
22
|
+
|
23
|
+
def stop_all_journeys(email:)
|
24
|
+
response = @request.put(endpoint: "/journeys/stop_all_journeys.json?email=#{CGI.escape(email)}")
|
25
|
+
Response.new(response: response, parser: @parser).call
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
data/lib/maropost_api/version.rb
CHANGED
data/readme.md
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
[](https://badge.fury.io/rb/maropost_api)
|
2
|
+
[](https://travis-ci.org/hosseintoussi/maropost_api)
|
2
3
|
|
3
4
|
# MaropostApi
|
4
5
|
|
@@ -48,6 +49,26 @@ client.contacts.update(contact_id: '<id>', params: {email: 'test@example.com', f
|
|
48
49
|
# To unsubscribe a contact from all lists
|
49
50
|
client.contacts.unsubscribe_all_lists(email: 'test@example.com')
|
50
51
|
|
52
|
+
# To check if a contact is in DNM list:
|
53
|
+
client.global_unsubscribes.find_by_email(email: 'test@example.com')
|
54
|
+
|
55
|
+
# To add a contact to DNM list:
|
56
|
+
client.global_unsubscribes.add_to_dnm(email: 'test@example.com')
|
57
|
+
|
58
|
+
# To start a journey for a contact
|
59
|
+
client.journeys.start(journey_id: '<journey_id>', contact_id: '<contact_id>')
|
60
|
+
|
61
|
+
# To stop journey for a contact
|
62
|
+
client.journeys.stop(journey_id: '<journey_id>', contact_id: '<contact_id>')
|
63
|
+
|
64
|
+
# To reset a journey for a contact
|
65
|
+
client.journeys.reset(journey_id: '<journey_id>', contact_id: '<contact_id>')
|
66
|
+
|
67
|
+
# To stop all journeys for a contact
|
68
|
+
client.journeys.stop_all_journeys(email: 'test@example.com')
|
69
|
+
|
70
|
+
## Endpoints that are going to be deprecated soon:
|
71
|
+
|
51
72
|
# To start a workflow for a contact
|
52
73
|
client.workflows.start(workflow_id: '<workflow_id>', contact_id: '<contact_id>')
|
53
74
|
|
@@ -56,12 +77,6 @@ client.workflows.stop(workflow_id: '<workflow_id>', contact_id: '<contact_id>')
|
|
56
77
|
|
57
78
|
# To reset a workflow for a contact
|
58
79
|
client.workflows.reset(workflow_id: '<workflow_id>', contact_id: '<contact_id>')
|
59
|
-
|
60
|
-
# To check if a contact is in DNM list:
|
61
|
-
client.global_unsubscribes.find_by_email(email: 'test@example.com')
|
62
|
-
|
63
|
-
# To add a contact to DNM list:
|
64
|
-
client.global_unsubscribes.add_to_dnm(email: 'test@example.com')
|
65
80
|
```
|
66
81
|
|
67
82
|
## Development
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: maropost_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hossein Toussi
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-09-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -133,6 +133,7 @@ extra_rdoc_files: []
|
|
133
133
|
files:
|
134
134
|
- ".gitignore"
|
135
135
|
- ".rspec"
|
136
|
+
- ".travis.yml"
|
136
137
|
- Gemfile
|
137
138
|
- LICENSE.txt
|
138
139
|
- Rakefile
|
@@ -143,6 +144,7 @@ files:
|
|
143
144
|
- lib/maropost_api/contacts.rb
|
144
145
|
- lib/maropost_api/errors.rb
|
145
146
|
- lib/maropost_api/global_unsubscribes.rb
|
147
|
+
- lib/maropost_api/journeys.rb
|
146
148
|
- lib/maropost_api/parser/entity_parser.rb
|
147
149
|
- lib/maropost_api/request.rb
|
148
150
|
- lib/maropost_api/response.rb
|