Integrates with salesforce allowing to add people as leads.
Add this line to your application's Gemfile:
gem 'rd-salesforce'And then execute:
$ bundle
Or install it yourself as:
$ gem install rd-salesforce
These library consists basically in:
- client.rb - wraps the RestForce api and authentication info.
- person.rb - stores and validates the person/lead info
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...."@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.
@person.upload_to_salesforce! @clientYou 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- Fork it ( https://github.com/jonatas/rd-salesforce/fork )
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request