infusionsoft 1.2.2 → 1.3.0a
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -3
- data/lib/infusionsoft/client/contact.rb +21 -10
- data/lib/infusionsoft/version.rb +1 -1
- metadata +5 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8a7e9e07a053e797587d945bbd72ae311eec9b3aac0eb5bebda59fe9512c7ccb
|
4
|
+
data.tar.gz: 28b23ae6b99cf7e146b476b922613b272c4f5acf0605bb5ea755eff0cd01e5ce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b8934f77b9f5e1d94bc9a9f24270bbf948f12491a1a4f0134e9a519d6a4c4b03a1b1c13f91b2ffa0ffff8b09504ee1577951ea3e4fb8c488c4404612517ece1c
|
7
|
+
data.tar.gz: a339f6b7bee9de9375190aa4fcf0b1df4d94c2fe9624b36f55b934c347f399650cb946b9a0cb53a4a6aff5882694ab87059682c604b91b516296012db26fda73
|
data/README.md
CHANGED
@@ -6,6 +6,8 @@
|
|
6
6
|
A Ruby wrapper for the Infusionsoft API
|
7
7
|
|
8
8
|
**update notes**
|
9
|
+
* upcoming - Adding support for rest api
|
10
|
+
* v1.2.2 - Catching Infusionsoft API SSL handshake issues
|
9
11
|
* v1.2.1 - Added OAuth support
|
10
12
|
* v1.2.0 - Added `invoice_add_subscription` call to mirror Infusionsoft API parameters to eventually replace `invoice_add_recurring_order`
|
11
13
|
* maybe?? - Going to add Infusionsoft API authentication Oauth flow. Also, I'm thinking of rewriting parts of it to make the calls more user friendly and adding some convenience methods. If you have any suggestions, let me know.
|
@@ -22,7 +24,7 @@ A Ruby wrapper for the Infusionsoft API
|
|
22
24
|
|
23
25
|
## <a name="setup">Setup & Configuration</a>
|
24
26
|
1. **Rails 2.3** - add `config.gem 'infusionsoft'` **Rails >= 3** - add `'infusionsoft'` to your `Gemfile`
|
25
|
-
2. Enable the API on your Infusionsoft account (if you haven't already) and generate your API Key: [See Infusionsoft Doc](
|
27
|
+
2. Enable the API on your Infusionsoft account (if you haven't already) and generate your API Key: [See Infusionsoft Doc](https://classic-infusionsoft.knowledgeowl.com/help/api-key)
|
26
28
|
3. Then create an initializer in `config\initializers` called infusionsoft.rb and the following
|
27
29
|
|
28
30
|
```ruby
|
@@ -120,7 +122,7 @@ time of a major release, support for that Ruby version may be dropped.
|
|
120
122
|
* Need to add a history log for additional contributers
|
121
123
|
|
122
124
|
## <a name="copyright">Copyright</a>
|
123
|
-
Copyright (c)
|
125
|
+
Copyright (c) 2019 Nathan Leavitt
|
124
126
|
|
125
|
-
See [LICENSE](https://github.com/nateleavitt/infusionsoft/blob/master/LICENSE.md) for details.
|
127
|
+
See [MIT LICENSE](https://github.com/nateleavitt/infusionsoft/blob/master/LICENSE.md) for details.
|
126
128
|
|
@@ -5,16 +5,19 @@ module Infusionsoft
|
|
5
5
|
module Contact
|
6
6
|
# Creates a new contact record from the data passed in the associative array.
|
7
7
|
#
|
8
|
-
# @param [Hash] data contains the mappable contact fields and it's data
|
8
|
+
# @param [Hash] data contains the mappable contact fields and it's data.
|
9
|
+
# @param [String] (Optional) email opt in verbiage. The contact will then be
|
10
|
+
# "Opted in" using the verviage supplied here.
|
9
11
|
# @return [Integer] the id of the newly added contact
|
10
12
|
# @example
|
11
|
-
# { :Email => 'test@test.com', :FirstName => 'first_name', :LastName => 'last_name' }
|
12
|
-
def contact_add(data)
|
13
|
+
# { :Email => 'test@test.com', :FirstName => 'first_name', :LastName => 'last_name' }, 'New Signup'
|
14
|
+
def contact_add(data, optin_status=nil)
|
13
15
|
contact_id = get('ContactService.add', data)
|
14
|
-
|
16
|
+
email = data['Email'] || data[:Email]
|
17
|
+
if optin_status && email; email_optin(email, optin_status); end
|
15
18
|
return contact_id
|
16
19
|
end
|
17
|
-
|
20
|
+
|
18
21
|
# Merge two contacts together.
|
19
22
|
#
|
20
23
|
# @param [Integer] contact_id
|
@@ -28,10 +31,15 @@ module Infusionsoft
|
|
28
31
|
# @param [Array<Hash>] data the contact data you want added
|
29
32
|
# @param [String] check_type available options are 'Email', 'EmailAndName',
|
30
33
|
# 'EmailAndNameAndCompany'
|
34
|
+
# @param [String] (Optional) email opt in verbiage. The contact will then be
|
35
|
+
# "Opted in" using the verviage supplied here.
|
31
36
|
# @return [Integer] id of the contact added or updated
|
32
|
-
|
37
|
+
# @example
|
38
|
+
# { :Email => 'test@test.com', :FirstName => 'first_name', :LastName => 'last_name' }, 'Email', 'New Signup'
|
39
|
+
def contact_add_with_dup_check(data, check_type, optin_status=nil)
|
33
40
|
contact_id = get('ContactService.addWithDupCheck', data, check_type)
|
34
|
-
|
41
|
+
email = data['Email'] || data[:Email]
|
42
|
+
if optin_status && email; email_optin(email, optin_status); end
|
35
43
|
return contact_id
|
36
44
|
end
|
37
45
|
|
@@ -39,12 +47,15 @@ module Infusionsoft
|
|
39
47
|
#
|
40
48
|
# @param [Integer] contact_id
|
41
49
|
# @param [Hash] data contains the mappable contact fields and it's data
|
50
|
+
# @param [String] (Optional) email opt in verbiage. The contact will then be
|
51
|
+
# "Opted in" using the verviage supplied here.
|
42
52
|
# @return [Integer] the id of the contact updated
|
43
53
|
# @example
|
44
|
-
# { :FirstName => 'first_name', :StreetAddress1 => '123 N Street' }
|
45
|
-
def contact_update(contact_id, data)
|
54
|
+
# { :FirstName => 'first_name', :StreetAddress1 => '123 N Street' }, 'New Signup'
|
55
|
+
def contact_update(contact_id, data, optin_status=nil)
|
46
56
|
contact_id = get('ContactService.update', contact_id, data)
|
47
|
-
|
57
|
+
email = data['Email'] || data[:Email]
|
58
|
+
if optin_status && email; email_optin(email, optin_status); end
|
48
59
|
return contact_id
|
49
60
|
end
|
50
61
|
|
data/lib/infusionsoft/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: infusionsoft
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0a
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Leavitt
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-03-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -113,12 +113,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
113
113
|
version: '0'
|
114
114
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
115
115
|
requirements:
|
116
|
-
- - "
|
116
|
+
- - ">"
|
117
117
|
- !ruby/object:Gem::Version
|
118
|
-
version: 1.3.
|
118
|
+
version: 1.3.1
|
119
119
|
requirements: []
|
120
|
-
|
121
|
-
rubygems_version: 2.7.6
|
120
|
+
rubygems_version: 3.0.1
|
122
121
|
signing_key:
|
123
122
|
specification_version: 4
|
124
123
|
summary: Ruby wrapper for the Infusionsoft API
|