lead_create 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/lead_create.rb +23 -0
  3. metadata +58 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 7ade48efd23fadb28fdb2d18b60bace7b64cd6ca
4
+ data.tar.gz: c181836827bc10c4f8c2de34dd36488590955de8
5
+ SHA512:
6
+ metadata.gz: 06e010731f6001dace73d1912fb680fe51be560b1496ff021a873ae9a4084862de714190eade74b1cd39462cf3b4df6e80e481f4d3f5a65e4760e9e675e7bd6d
7
+ data.tar.gz: 0fc4b4b01fdc1d0068132d4c936f7bd1fe3e6c2ba2895041c87c42c93ab8a19033b3e2981ade6a00564c615d944d85d8b85e3eab39aad9c532d6070adadf119a
@@ -0,0 +1,23 @@
1
+ class LeadCreate
2
+ def self.create(contato)
3
+ client = Databasedotcom::Client.new('config/databasedotcom.yml')
4
+ # client.authenticate :token => 'DT0tilUUmpLca7X5kWKGCKDf', :instance_url => 'http://na1.salesforce.com' #=> "my-oauth-token"
5
+ client.authenticate :username => 'matheuslucena@gmail.com', :password => 'slayer666DT0tilUUmpLca7X5kWKGCKDf'
6
+ lead = client.materialize('Lead')
7
+ user = client.materialize('User')
8
+ @lead = lead.new
9
+ @lead.OwnerId = user.first.id
10
+ @lead.FirstName = contato.name
11
+ @lead.LastName = contato.last_name
12
+ @lead.Email = contato.email
13
+ @lead.Company = contato.company
14
+ @lead.Title = contato.job_title
15
+ @lead.Phone = contato.phone
16
+ @lead.Website = contato.website
17
+ @lead.IsConverted = false
18
+ @lead.IsUnreadByOwner = true
19
+ if @lead.save
20
+ contato.name + ' successfully added'
21
+ end
22
+ end
23
+ end
metadata ADDED
@@ -0,0 +1,58 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: lead_create
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Matheus Lucena
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-08-10 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: databasedotcom
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ description: A gem to create a lead in the salesforce
28
+ email: matheuslucena@gmail.com
29
+ executables: []
30
+ extensions: []
31
+ extra_rdoc_files: []
32
+ files:
33
+ - lib/lead_create.rb
34
+ homepage: http://rubygems.org/gems/lead_create
35
+ licenses:
36
+ - MIT
37
+ metadata: {}
38
+ post_install_message:
39
+ rdoc_options: []
40
+ require_paths:
41
+ - lib
42
+ required_ruby_version: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - '>='
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
47
+ required_rubygems_version: !ruby/object:Gem::Requirement
48
+ requirements:
49
+ - - '>='
50
+ - !ruby/object:Gem::Version
51
+ version: '0'
52
+ requirements: []
53
+ rubyforge_project:
54
+ rubygems_version: 2.4.7
55
+ signing_key:
56
+ specification_version: 4
57
+ summary: Lead create
58
+ test_files: []