mailflow-ruby 0.1.0 → 0.1.1
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/LICENSE.txt +1 -1
- data/README.md +113 -2
- data/lib/mailflow-ruby/attribute.rb +1 -1
- data/lib/mailflow-ruby/client.rb +4 -3
- data/lib/mailflow-ruby/contact.rb +6 -3
- data/lib/mailflow-ruby/version.rb +2 -2
- data/lib/mailflow-ruby.rb +2 -1
- data/mailflow-ruby-0.1.0.gem +0 -0
- data/mailflow-ruby.gemspec +7 -7
- metadata +15 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ce09fe7f6df53a28394ca9924919c22a2ad87200
|
4
|
+
data.tar.gz: 659b72f988696c8ba0431fd3266cfa6d0e6a9a24
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 90892ce44418384be79a913c57c860d548560a7edff74e166c8494b5396a0d676571ddaf860a5230124a4b2a61125dbf4276e85b343741fd7955e93a8022f468
|
7
|
+
data.tar.gz: ccc65993807d6799120056392ac4c96de016adab355edc47eda6c518259eec39b5298a238c5b807e142bbbb6912b152780ade54c0199639017cadb624a963c96
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -1,3 +1,114 @@
|
|
1
|
-
|
1
|
+
# Mailflow Ruby library
|
2
2
|
|
3
|
-
|
3
|
+
This is Mailflow's official Ruby library. It allows convenient access to the Mailflow API, which allows you to:
|
4
|
+
|
5
|
+
* Get, create and delete contacts
|
6
|
+
* Update attributes for a specific contact
|
7
|
+
* Tag and untag a specific contact
|
8
|
+
* Trigger sequences on contact tag
|
9
|
+
|
10
|
+
## Getting started
|
11
|
+
|
12
|
+
### Install the gem
|
13
|
+
|
14
|
+
gem install mailflow-ruby
|
15
|
+
|
16
|
+
### Provide API credentials
|
17
|
+
|
18
|
+
You can find your API credentials in the [Integrations section](https://mailflow.com/integrations/mailflow) of the Mailflow app.
|
19
|
+
|
20
|
+
```ruby
|
21
|
+
require 'mailflow-ruby'
|
22
|
+
|
23
|
+
Mailflow.setup('API_KEY', 'SECRET_KEY')
|
24
|
+
```
|
25
|
+
|
26
|
+
### List all contacts
|
27
|
+
|
28
|
+
```ruby
|
29
|
+
Mailflow::Contact.list
|
30
|
+
```
|
31
|
+
|
32
|
+
## Contacts
|
33
|
+
|
34
|
+
#### Basic contact operations
|
35
|
+
|
36
|
+
|
37
|
+
Get a contact by email address or contact ID:
|
38
|
+
|
39
|
+
```ruby
|
40
|
+
Mailflow::Contact.get({email: 'foo@example.com'})
|
41
|
+
Mailflow::Contact.get({contact_id: 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11'})
|
42
|
+
```
|
43
|
+
|
44
|
+
|
45
|
+
Create an unconfirmed contact (this will send the contact an opt-in email):
|
46
|
+
|
47
|
+
```ruby
|
48
|
+
Mailflow::Contact.create({email: 'foo@example.com'})
|
49
|
+
```
|
50
|
+
|
51
|
+
|
52
|
+
Create a confirmed contact (and don't send an opt-in email)
|
53
|
+
|
54
|
+
```ruby
|
55
|
+
Mailflow::Contact.create({email: 'foo@example.com', confirmed: true})
|
56
|
+
```
|
57
|
+
|
58
|
+
|
59
|
+
### Contact tag operations
|
60
|
+
|
61
|
+
|
62
|
+
List a contact's tags:
|
63
|
+
|
64
|
+
```ruby
|
65
|
+
contact = Mailflow::Contact.get({email: 'foo@example.com'})
|
66
|
+
contact.tags
|
67
|
+
```
|
68
|
+
|
69
|
+
|
70
|
+
Tag a contact (accepts an array only):
|
71
|
+
|
72
|
+
```ruby
|
73
|
+
contact = Mailflow::Contact.get({email: 'foo@example.com'})
|
74
|
+
contact.tag(['Foo', 'Bar'])
|
75
|
+
```
|
76
|
+
|
77
|
+
|
78
|
+
Tag a contact and trigger any relevant sequences:
|
79
|
+
|
80
|
+
```ruby
|
81
|
+
contact = Mailflow::Contact.get({email: 'foo@example.com'})
|
82
|
+
contact.tag(['Foo', 'Bar'], true)
|
83
|
+
```
|
84
|
+
|
85
|
+
|
86
|
+
Untag a contact (accepts an array only):
|
87
|
+
|
88
|
+
```ruby
|
89
|
+
contact = Mailflow::Contact.get({email: 'foo@example.com'})
|
90
|
+
contact.untag(['Foo', 'Bar'])
|
91
|
+
```
|
92
|
+
|
93
|
+
|
94
|
+
### Contact attribute operations
|
95
|
+
|
96
|
+
|
97
|
+
List a contact's attributes:
|
98
|
+
|
99
|
+
```ruby
|
100
|
+
contact = Mailflow::Contact.get({email: 'foo@example.com'})
|
101
|
+
contact.attributes
|
102
|
+
```
|
103
|
+
|
104
|
+
|
105
|
+
Set attributes on a contact:
|
106
|
+
|
107
|
+
```ruby
|
108
|
+
contact = Mailflow::Contact.get({email: 'foo@example.com'})
|
109
|
+
contact.set_attributes({'First name' => 'Foo', 'Last name' => 'Bar' })
|
110
|
+
```
|
111
|
+
|
112
|
+
## More information
|
113
|
+
|
114
|
+
Contact support@mailflow.com for more information.
|
data/lib/mailflow-ruby/client.rb
CHANGED
@@ -8,15 +8,16 @@ module Mailflow
|
|
8
8
|
class << self
|
9
9
|
attr_accessor :test_mode
|
10
10
|
end
|
11
|
-
|
11
|
+
|
12
12
|
class Client
|
13
13
|
|
14
14
|
include Mailflow::APIOperations
|
15
15
|
|
16
16
|
def self.test
|
17
|
-
|
17
|
+
response = get_request('test')
|
18
|
+
return {status: response.code}
|
18
19
|
end
|
19
20
|
|
20
21
|
end
|
21
22
|
|
22
|
-
end
|
23
|
+
end
|
@@ -49,12 +49,14 @@ module Mailflow
|
|
49
49
|
Mailflow::Tag.list(contact_id: id)
|
50
50
|
end
|
51
51
|
|
52
|
-
def tag(tags)
|
53
|
-
Mailflow::Tag.create(tags, {contact_id: id})
|
52
|
+
def tag(tags, trigger = false)
|
53
|
+
Mailflow::Tag.create(tags, {contact_id: id}, trigger)
|
54
|
+
self
|
54
55
|
end
|
55
56
|
|
56
57
|
def untag(tags)
|
57
58
|
Mailflow::Tag.untag(tags, {contact_id: id})
|
59
|
+
self
|
58
60
|
end
|
59
61
|
|
60
62
|
def attributes
|
@@ -67,8 +69,9 @@ module Mailflow
|
|
67
69
|
end
|
68
70
|
|
69
71
|
Mailflow::Attribute.update(attributes, {contact_id: id})
|
72
|
+
self
|
70
73
|
end
|
71
74
|
|
72
75
|
end
|
73
76
|
|
74
|
-
end
|
77
|
+
end
|
@@ -1,3 +1,3 @@
|
|
1
1
|
module Mailflow
|
2
|
-
VERSION = '0.1.
|
3
|
-
end
|
2
|
+
VERSION = '0.1.1'
|
3
|
+
end
|
data/lib/mailflow-ruby.rb
CHANGED
Binary file
|
data/mailflow-ruby.gemspec
CHANGED
@@ -6,11 +6,11 @@ require 'mailflow-ruby/version.rb'
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "mailflow-ruby"
|
8
8
|
spec.version = Mailflow::VERSION
|
9
|
-
spec.authors = ["
|
10
|
-
spec.email = ["
|
9
|
+
spec.authors = ["Mailflow"]
|
10
|
+
spec.email = ["support@mailflow.com"]
|
11
11
|
|
12
|
-
spec.summary = "Mailflow's
|
13
|
-
spec.homepage = "https://mailflow.com"
|
12
|
+
spec.summary = "The official Ruby library for Mailflow's API"
|
13
|
+
spec.homepage = "https://mailflow.com/support/api-reference"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
16
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
@@ -19,9 +19,9 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
21
|
# Gems for production
|
22
|
-
spec.add_dependency "httparty"
|
23
|
-
spec.add_dependency "hashie"
|
24
|
-
|
22
|
+
spec.add_dependency "httparty", "~> 0.13.5"
|
23
|
+
spec.add_dependency "hashie", "~> 3.4.2"
|
24
|
+
|
25
25
|
# Gems for dev
|
26
26
|
spec.add_development_dependency "bundler", "~> 1.10"
|
27
27
|
spec.add_development_dependency "rspec"
|
metadata
CHANGED
@@ -1,44 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mailflow-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
8
|
-
- Alex Rowan
|
7
|
+
- Mailflow
|
9
8
|
autorequire:
|
10
9
|
bindir: exe
|
11
10
|
cert_chain: []
|
12
|
-
date: 2016-02
|
11
|
+
date: 2016-03-02 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: httparty
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
16
|
requirements:
|
18
|
-
- - "
|
17
|
+
- - "~>"
|
19
18
|
- !ruby/object:Gem::Version
|
20
|
-
version:
|
19
|
+
version: 0.13.5
|
21
20
|
type: :runtime
|
22
21
|
prerelease: false
|
23
22
|
version_requirements: !ruby/object:Gem::Requirement
|
24
23
|
requirements:
|
25
|
-
- - "
|
24
|
+
- - "~>"
|
26
25
|
- !ruby/object:Gem::Version
|
27
|
-
version:
|
26
|
+
version: 0.13.5
|
28
27
|
- !ruby/object:Gem::Dependency
|
29
28
|
name: hashie
|
30
29
|
requirement: !ruby/object:Gem::Requirement
|
31
30
|
requirements:
|
32
|
-
- - "
|
31
|
+
- - "~>"
|
33
32
|
- !ruby/object:Gem::Version
|
34
|
-
version:
|
33
|
+
version: 3.4.2
|
35
34
|
type: :runtime
|
36
35
|
prerelease: false
|
37
36
|
version_requirements: !ruby/object:Gem::Requirement
|
38
37
|
requirements:
|
39
|
-
- - "
|
38
|
+
- - "~>"
|
40
39
|
- !ruby/object:Gem::Version
|
41
|
-
version:
|
40
|
+
version: 3.4.2
|
42
41
|
- !ruby/object:Gem::Dependency
|
43
42
|
name: bundler
|
44
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -111,7 +110,7 @@ dependencies:
|
|
111
110
|
version: '0'
|
112
111
|
description:
|
113
112
|
email:
|
114
|
-
-
|
113
|
+
- support@mailflow.com
|
115
114
|
executables: []
|
116
115
|
extensions: []
|
117
116
|
extra_rdoc_files: []
|
@@ -133,8 +132,9 @@ files:
|
|
133
132
|
- lib/mailflow-ruby/contact.rb
|
134
133
|
- lib/mailflow-ruby/tag.rb
|
135
134
|
- lib/mailflow-ruby/version.rb
|
135
|
+
- mailflow-ruby-0.1.0.gem
|
136
136
|
- mailflow-ruby.gemspec
|
137
|
-
homepage: https://mailflow.com
|
137
|
+
homepage: https://mailflow.com/support/api-reference
|
138
138
|
licenses:
|
139
139
|
- MIT
|
140
140
|
metadata: {}
|
@@ -157,5 +157,5 @@ rubyforge_project:
|
|
157
157
|
rubygems_version: 2.4.8
|
158
158
|
signing_key:
|
159
159
|
specification_version: 4
|
160
|
-
summary: Mailflow's
|
160
|
+
summary: The official Ruby library for Mailflow's API
|
161
161
|
test_files: []
|