markety 2.0 → 2.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 25aa090dddf2dca7a190899e70ce66ac662ecab3
4
- data.tar.gz: b119fbfeb5efaa8d15c7d69f47981bc21fa46dd8
3
+ metadata.gz: 38cc31c8cd2077f0868313952b394f8c47712512
4
+ data.tar.gz: 9016bdefb8cd7d9aaec957379d90004e02d02952
5
5
  SHA512:
6
- metadata.gz: 9464756adc7f3d10e1311e91c5ed47f8cd8a411654b6592a43c05f1fa6e5dcfc3d151d4ee4b1066616dbf28d788f37d37454e62b7c4c1d9d224ad6c13530b218
7
- data.tar.gz: 7ede8c5d94a769c3bf42b6ffd4fcc27e618b770ddae340c32538e05ea94fa67cb77adc1cc1a9476e1beb07d5ee74fcb9d7d2734d373eb4387c1642906ca21700
6
+ metadata.gz: 29ab1101e22a4cfde02a7e7ff879e2ecd15cfe74426057a20b6d48bc865a1b71b275fcf39dd33d882532b477ca9056f43262bae062ee94bd726a3f9af194414e
7
+ data.tar.gz: 13de0488f4d123ffa13dd63fcf8c70b3467b05a1829b2c837a4b19b99a49b6c7624b44144d0bb64e9dc30ba0b4ff3981a4c60721f1cedbe30cdf2417fbdd18eb
data/README.md CHANGED
@@ -15,7 +15,7 @@ Add this your Gemfile:
15
15
  gem 'markety'
16
16
  ```
17
17
 
18
- and run bundle install.
18
+ and run `bundle install`.
19
19
 
20
20
  ## Getting Started
21
21
 
@@ -26,13 +26,11 @@ client = Markety::Client.new(USER_ID, ENCRYPTION_KEY, END_POINT)
26
26
  client = Markety.::Client.new(USER_ID, ENCRYPTION_KEY, END_POINT, target_workspace: "ws_name")
27
27
  ```
28
28
 
29
- You can get leads from Marketo by idnum or by email. Markety returns a ``GetLeadResponse`` object
30
- which is an array of leads. Getting a lead by idnum will return a single lead, however because
31
- Marketo allows for an email address to be tied to more than one lead getting by email could
32
- potentially result in an array of leads with the same email address.
29
+ You can get leads from Marketo by idnum or by email. Markety returns a ``GetLeadResponse`` object which contains an array of leads. Because Marketo allows for an email address to be tied to more than one lead, getting by email could
30
+ potentially result in an array of leads with the same email address so you can call ``.leads`` to get all the leads in the array. Getting a lead by idnum will return a single lead, however because ``GetLeadResponse`` is an array of leads, you'll need to add ``.lead`` to get the lead from the response.
33
31
  ```ruby
34
32
  # By idnum
35
- lead = client.get_lead_by_idnum("123456").lead # Lead object (or nil)
33
+ lead = client.get_lead_by_idnum("123456").lead # Single lead object (or nil)
36
34
 
37
35
  # By email
38
36
  leads = client.get_leads_by_email("joe@example.com").leads # array of Leads
@@ -47,8 +45,7 @@ lead.set_attribute("Email", "joe-schmoe@example.com")
47
45
  lead.set_attribute("Activated", true, "Boolean") # [1] see below
48
46
  ```
49
47
 
50
- Once you're ready to sync back, just tell Markety how you'd like it to sync. There are currently
51
- 3 supported methods, "EMAIL", "MARKETO_ID" and "FOREIGN_ID"
48
+ Once you're ready to sync back, just tell Markety how you'd like it to sync. There are currently 3 supported methods, "EMAIL", "MARKETO_ID" and "FOREIGN_ID"
52
49
  ```
53
50
  # Sync the lead with Marketo
54
51
  response = client.sync_lead_record(lead, "EMAIL")
@@ -68,8 +65,7 @@ client.add_to_list('The_List_Name', lead.idnum).list_operation_status #true if s
68
65
  client.remove_from_list('The_List_Name', lead.idnum).list_operation_status #true if successful removal
69
66
  ```
70
67
 
71
- Lastly, if you would like to create a lead in Marketo via markety, you can use the sync lead method the
72
- same way you would use the syncy lead to update a lead. Just start by instantiating a Markety::Lead.
68
+ Lastly, if you would like to create a lead in Marketo, you can use the sync lead method the same way you would use the sync lead to update a lead. Just start by instantiating a Markety::Lead.
73
69
  ```ruby
74
70
  new_lead = Markety::Lead.new
75
71
  new_lead.set_attribute("Email", "doge@suchemail.com")
@@ -85,13 +81,12 @@ _(Admin » Field Management » New Custom Field)_
85
81
 
86
82
  ```ruby
87
83
  # Turn of Savon logging - logging is helpful during development, but outputs a lot of text which you may not want in production
88
- client = Markety.new_client(USER_ID, ENCRYPTION_KEY, END_POINT, { log: false })
84
+ client = Markety::Client.new(USER_ID, ENCRYPTION_KEY, END_POINT, { log: false })
89
85
  ```
90
86
 
91
87
  ## Contributing
92
88
 
93
- PRs are very welcome! Feel free to send a PR for any endpoint you might need. Unfortunately Markety
94
- development has slowed a bit in the last few months.
89
+ PRs are very welcome! Feel free to send a PR for any endpoint you might need.
95
90
 
96
91
  1. Fork it
97
92
  2. Create your feature branch (`git checkout -b my-new-feature`)
@@ -108,4 +103,4 @@ development has slowed a bit in the last few months.
108
103
  Marketo released a lead REST API on June 20, 2014 so be sure to check developers.marketo.com for another lead management integration possibility.
109
104
 
110
105
  ## Authors
111
- David Santoso and Grant Birchmeier.
106
+ David Santoso and [Grant Birchmeier](https://github.com/gbirchmeier).
@@ -10,6 +10,10 @@ module Markety
10
10
 
11
11
  attr_reader :target_workspace
12
12
 
13
+ # Supported +options+:
14
+ #
15
+ # * +:log+ (bool) - enable/disable Savon logging (default: true)
16
+ # * +:target_workspace+ (string) - name of workspace to use, if any
13
17
  def initialize(access_key, secret_key, end_point, options = {})
14
18
  api_version = options.fetch(:api_version, '2_3')
15
19
 
@@ -15,6 +15,9 @@ module Markety
15
15
  get_lead(LeadKey.new(LeadKeyType::EMAIL, email))
16
16
  end
17
17
 
18
+ def get_lead_by_cookie(cookie)
19
+ get_lead(LeadKey.new(LeadKeyType::COOKIE, cookie))
20
+ end
18
21
 
19
22
  private
20
23
 
data/lib/markety/enums.rb CHANGED
@@ -4,8 +4,8 @@ module Markety
4
4
  module LeadKeyType
5
5
  IDNUM = "IDNUM"
6
6
  EMAIL = "EMAIL"
7
+ COOKIE = "COOKIE"
7
8
 
8
- # COOKIE = "COOKIE"
9
9
  # LEADOWNEREMAIL = "LEADOWNEREMAIL"
10
10
  # SFDCACCOUNTID = "SFDCACCOUNTID"
11
11
  # SFDCCONTACTID = "SFDCCONTACTID"
@@ -1,3 +1,3 @@
1
1
  module Markety
2
- VERSION = "2.0"
2
+ VERSION = "2.1.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: markety
3
3
  version: !ruby/object:Gem::Version
4
- version: '2.0'
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Santoso
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-29 00:00:00.000000000 Z
11
+ date: 2014-11-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler