A Ruby wrapper for the Iterable API. Documentation can be found here.
Add this line to your application's Gemfile:
gem 'iterable-ruby', require: 'iterable'
And then execute:
$ bundle
Or install it yourself as:
$ gem install iterable-ruby
require 'iterable-ruby`
client = Iterable::Api.new('YOUR_API_KEY')
client.lists
All responses are sent back as Hashie
objects
email/target
- send a targeted email
client = Iterable::Api.new('YOUR_API_KEY')
client.send_email(Iterable::Requests::TargetedEmail)
events/track
- track an event
client = Iterable::Api.new('YOUR_API_KEY')
client.track_event(Iterable::Requests::TrackEvent)
lists
- return all listslists/subscribe
- subscribe a user to a list
client = Iterable::Api.new('YOUR_API_KEY')
client.lists_subscribe(list_id, [Iterable::User])
lists/unsubscribe
- unsubscribe a user to a list
client = Iterable::Api.new('YOUR_API_KEY')
client.lists_unsubscribe(list_id, [Iterable::User])
messageTypes
- return all Message Types
client = Iterable::Api.new('YOUR_API_KEY')
client.message_types
#### Templates
* `templates` - return all templates
```ruby
client = Iterable::Api.new('YOUR_API_KEY')
client.templates
users/getFields
- get user fieldsusers/{email}
- find a user by emailusers/{id}
- find a user by idusers/update
- update a user
client = Iterable::Api.new('YOUR_API_KEY')
client.user_update(Iterable::User)
users/updateSubscriptions
- update a user's subscriptions
client = Iterable::Api.new('YOUR_API_KEY')
client.user_update_subscriptions(Iterable::Requests::SubscriptionUpdate)
client.unsubscribe_all("email_address")
commerce/track_purchase
- create a new CommerceItem
After checking out the repo, run bin/setup
to install dependencies. Then, run rake spec
to run the tests. You can also run bin/console
for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install
. To release a new version, update the version number in version.rb
, and then run bundle exec rake release
, which will create a git tag for the version, push git commits and tags, and push the .gem
file to rubygems.org.
Bug reports and pull requests are welcome on GitHub at https://github.com/movewith/iterable-ruby.
The gem is available as open source under the terms of the MIT License.