infusionsoft 1.3.2a → 1.3.4a

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c3b686d1efc5164b0bba431d6eacde2489cd926bac5e3fe026f53f025371bcbc
4
- data.tar.gz: 18e910421637b87d1a75948725e95aeca05f12dfb69db67fcc1a046a6f016196
3
+ metadata.gz: cec72d87426cef1d6cf6a94f012134a9aa250cbca526fb8d044b3194df6c816c
4
+ data.tar.gz: 8001bfbef6bba9d848418c3995d4c4b3d06687545439991142fe5f290edd903b
5
5
  SHA512:
6
- metadata.gz: 3d1fda73ce49ace6109dda85ddf2e5114975dfa11ec6a4227f14c0ec9f724f24fbc61b30f29668b5a506a29b946920dfea5edf6a35d2ebd96ada1198f1704a02
7
- data.tar.gz: 1fd016e8d6c90dfe1c1ae3e71b3e7877fbf11cc2e4c4b9e2cec95f680f632c72775368209ab6edbce4c0055cccc74e4c0c38d7d893ba4ea3e14941edbe328508
6
+ metadata.gz: '03944b06706c4d4552b830a50f5c0d726bb82801720637cf7a332cfba22592ac6cb99aae967cdbdd13bb85316c6a944a01306505a4df640f082ef1406b76e9bc'
7
+ data.tar.gz: d12e72fd7d49f004fd3799b3403d395b990ad816543f2967d95b3836595523766e802e578a1d0457ce33d3d876274b22f8bc4810c252a581ad081c2fd20bb2c1
data/README.md CHANGED
@@ -122,7 +122,7 @@ time of a major release, support for that Ruby version may be dropped.
122
122
  * Need to add a history log for additional contributers
123
123
 
124
124
  ## <a name="copyright">Copyright</a>
125
- Copyright (c) 2017 Nathan Leavitt
125
+ Copyright (c) 2019 Nathan Leavitt
126
126
 
127
- 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.
128
128
 
@@ -5,13 +5,16 @@ 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 = xmlrpc('ContactService.add', data)
14
- if data.has_key?(:Email); email_optin(data[:Email], "requested information"); end
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
 
@@ -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
- def contact_add_with_dup_check(data, check_type)
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 = xmlrpc('ContactService.addWithDupCheck', data, check_type)
34
- if data.has_key?(:Email); email_optin(data[:Email], "requested information"); end
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 = xmlrpc('ContactService.update', contact_id, data)
47
- if data.has_key?(:Email); email_optin(data[:Email], "requested information"); end
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
 
@@ -1,4 +1,4 @@
1
1
  module Infusionsoft
2
2
  # The version of the gem
3
- VERSION = '1.3.2a'.freeze unless defined?(::Infusionsoft::VERSION)
3
+ VERSION = '1.3.4a'.freeze unless defined?(::Infusionsoft::VERSION)
4
4
  end
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.3.2a
4
+ version: 1.3.4a
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Leavitt
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-24 00:00:00.000000000 Z
11
+ date: 2019-03-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -146,8 +146,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
146
146
  - !ruby/object:Gem::Version
147
147
  version: 1.3.1
148
148
  requirements: []
149
- rubyforge_project:
150
- rubygems_version: 2.7.6
149
+ rubygems_version: 3.0.1
151
150
  signing_key:
152
151
  specification_version: 4
153
152
  summary: Ruby wrapper for the Infusionsoft API