Skip to content
This repository was archived by the owner on Jun 28, 2023. It is now read-only.

jonatas/rd-salesforce

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rd::Salesforce

Integrates with salesforce allowing to add people as leads.

Installation

Add this line to your application's Gemfile:

gem 'rd-salesforce'

And then execute:

$ bundle

Or install it yourself as:

$ gem install rd-salesforce

Usage

These library consists basically in:

Setup a client

You can use the same RestForce params to authentication to the client:

@client = Rd::Salesforce::Client.new instance_url: "https://xx.salesforce.com",
  oauth_token: "xxxxx...."

Instance a person

@person = Rd::Salesforce::Person.new
@person.first_name = "Jônatas"
@person.last_name = "Paganini"
@person.email = "jonatasdp@gmail.com"

You can see all the attributes at person.rb.

Upload person to salesforce with the client

@person.upload_to_salesforce! @client

Setting up a different translation to salesforce fields

You can manage/override the fields connection that will be sent to salesforce via managing the translate hash.

Rd::Salesforce::Person.translate = {
  :first_name => "FirstName",
  :last_name => "LastName",
  :email => "Email",
  :company => "Company",
  :website => "Website",
  :job_title => "Title",
  :phone => "Phone"
}

Or simple avoid send one attribute.

Rd::Salesforce::Person.translate.delete :job_title

Contributing

  1. Fork it ( https://github.com/jonatas/rd-salesforce/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

About

Rd Salesforce Challenge. Integration to upload a Lead.

Resources

License

MIT, MIT licenses found

Licenses found

MIT
LICENSE
MIT
LICENSE.txt

Stars

Watchers

Forks

Packages

No packages published

Languages