markety 2.1.0 → 2.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +23 -7
- data/lib/markety/lead.rb +1 -0
- data/lib/markety/version.rb +1 -1
- data/spec/markety/lead_spec.rb +8 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b1347cb773faa75e338f11502d21809049000dd0
|
4
|
+
data.tar.gz: 24b107c2113c0b2584f2d640bbe470025f8817ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 93d3ce0bab7a5663f01508adbab902a27529c8f92a48633aece92c9500a32f37a0914f5af7fe6b4199464ad10f973c758ed5b9b6da390a9a67133d6029a0b10b
|
7
|
+
data.tar.gz: a41153b4bb03266193dc9969db45fabdb85d362c3ce051bbd275928b582471ea12cc00212a6a571c471d95287beb0edfbe2c5f595062dde5dac91e0f572e8b5c
|
data/README.md
CHANGED
@@ -23,11 +23,15 @@ Instantiate a new Markety client using your Marketo SOAP endpoint, User ID, and
|
|
23
23
|
```ruby
|
24
24
|
client = Markety::Client.new(USER_ID, ENCRYPTION_KEY, END_POINT)
|
25
25
|
# or, if using a workspace:
|
26
|
-
client = Markety
|
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``
|
30
|
-
|
29
|
+
You can get leads from Marketo by idnum or by email. Markety returns a ``GetLeadResponse``
|
30
|
+
object which contains an array of leads. Because Marketo allows for an email address to be
|
31
|
+
tied to more than one lead, getting by email could potentially result in an array of leads
|
32
|
+
with the same email address so you can call ``.leads`` to get all the leads in the array.
|
33
|
+
Getting a lead by idnum will return a single lead, however because ``GetLeadResponse`` is
|
34
|
+
an array of leads, you'll need to add ``.lead`` to get the lead from the response.
|
31
35
|
```ruby
|
32
36
|
# By idnum
|
33
37
|
lead = client.get_lead_by_idnum("123456").lead # Single lead object (or nil)
|
@@ -45,7 +49,8 @@ lead.set_attribute("Email", "joe-schmoe@example.com")
|
|
45
49
|
lead.set_attribute("Activated", true, "Boolean") # [1] see below
|
46
50
|
```
|
47
51
|
|
48
|
-
Once you're ready to sync back, just tell Markety how you'd like it to sync.
|
52
|
+
Once you're ready to sync back, just tell Markety how you'd like it to sync.
|
53
|
+
There are currently 3 supported methods, "EMAIL", "MARKETO_ID" and "FOREIGN_ID"
|
49
54
|
```
|
50
55
|
# Sync the lead with Marketo
|
51
56
|
response = client.sync_lead_record(lead, "EMAIL")
|
@@ -65,7 +70,8 @@ client.add_to_list('The_List_Name', lead.idnum).list_operation_status #true if s
|
|
65
70
|
client.remove_from_list('The_List_Name', lead.idnum).list_operation_status #true if successful removal
|
66
71
|
```
|
67
72
|
|
68
|
-
Lastly, if you would like to create a lead in Marketo, you can use the sync lead method the same way
|
73
|
+
Lastly, if you would like to create a lead in Marketo, you can use the sync lead method the same way
|
74
|
+
you would use the sync lead to update a lead. Just start by instantiating a Markety::Lead.
|
69
75
|
```ruby
|
70
76
|
new_lead = Markety::Lead.new
|
71
77
|
new_lead.set_attribute("Email", "doge@suchemail.com")
|
@@ -80,7 +86,8 @@ _(Admin » Field Management » New Custom Field)_
|
|
80
86
|
## Options
|
81
87
|
|
82
88
|
```ruby
|
83
|
-
# Turn
|
89
|
+
# Turn off Savon logging - logging is helpful during development,
|
90
|
+
# but outputs a lot of text which you may not want in production
|
84
91
|
client = Markety::Client.new(USER_ID, ENCRYPTION_KEY, END_POINT, { log: false })
|
85
92
|
```
|
86
93
|
|
@@ -94,13 +101,22 @@ PRs are very welcome! Feel free to send a PR for any endpoint you might need.
|
|
94
101
|
4. Push to the branch (`git push origin my-new-feature`)
|
95
102
|
5. Create new Pull Request
|
96
103
|
|
104
|
+
###Dev hint:
|
105
|
+
|
106
|
+
In `irb`, from this repo's root dir, this will load the Markety classes:
|
107
|
+
|
108
|
+
> $LOAD_PATH.unshift "./lib"
|
109
|
+
> require 'markety'
|
110
|
+
|
111
|
+
|
97
112
|
## To Do's
|
98
113
|
1. More tests.
|
99
114
|
2. Add campaign endpoints.
|
100
115
|
|
101
116
|
## Marketo Lead REST API
|
102
117
|
|
103
|
-
Marketo released a lead REST API on June 20, 2014 so be sure to check developers.marketo.com
|
118
|
+
Marketo released a lead REST API on June 20, 2014 so be sure to check developers.marketo.com
|
119
|
+
for another lead management integration possibility.
|
104
120
|
|
105
121
|
## Authors
|
106
122
|
David Santoso and [Grant Birchmeier](https://github.com/gbirchmeier).
|
data/lib/markety/lead.rb
CHANGED
data/lib/markety/version.rb
CHANGED
data/spec/markety/lead_spec.rb
CHANGED
@@ -5,7 +5,6 @@ module Markety
|
|
5
5
|
IDNUM = 93480938
|
6
6
|
|
7
7
|
|
8
|
-
|
9
8
|
describe Lead do
|
10
9
|
it "should store the idnum" do
|
11
10
|
lead_record = Lead.new(email:EMAIL, idnum:IDNUM)
|
@@ -25,7 +24,13 @@ module Markety
|
|
25
24
|
lead_record2.set_attribute('favourite color', 'red')
|
26
25
|
lead_record2.set_attribute('age', '100')
|
27
26
|
|
28
|
-
lead_record1.should
|
27
|
+
(lead_record1==lead_record2).should be true
|
28
|
+
|
29
|
+
lead_record2.set_attribute('age', '200')
|
30
|
+
(lead_record1==lead_record2).should be false
|
31
|
+
|
32
|
+
# issue 21
|
33
|
+
(lead_record1==123).should be false
|
29
34
|
end
|
30
35
|
|
31
36
|
it "should store when attributes are set" do
|
@@ -99,5 +104,6 @@ module Markety
|
|
99
104
|
|
100
105
|
actual.should == expected
|
101
106
|
end
|
107
|
+
|
102
108
|
end
|
103
109
|
end
|