PardotWrapper is a Ruby gem designed to simplify interactions with the Pardot API version 5. This gem provides a straightforward and efficient way to integrate Pardot's functionalities into Ruby applications, offering basic functionalities such as listing custom fields, viewing account information, creating prospects, and managing list memberships.
Add this line to your application's Gemfile:
gem 'pardot_wrapper'And then execute:
bundle installOr install it yourself as:
gem install pardot_wrapperTo start using PardotWrapper, configure the client with your OAuth credentials:
client = PardotWrapper.new(access_token, refresh_token, client_id, client_secret, pardot_business_unit_id, :production)- List Custom Fields
client.list_custom_fields- View Account information
client.get_account- Create Prospect
client.create_prospect(email, additional_params)- Create List Membership
client.create_list_membership(email, additional_params)PardotWrapper handles the renewal of the access token automatically using the provided refresh_token.
For setting up the gem in a Rails environment, you might consider placing the initialization inside an initializer, such as config/initializers/pardot_wrapper.rb.
The gem includes a suite of unit tests using RSpec. To run the tests, execute:
bundle exec rspecContributions to PardotWrapper are welcome! To contribute:
- Fork the project.
- Create a 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.
This gem is available under the MIT License. See the LICENSE file for more details.