Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
SOAP Client for CleverElements API, please see upstream repo @kayoom, this fork is only for Travis CI
branch: master

This branch is 9 commits behind kayoom:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
spec
.gitignore
.travis.yml
Gemfile
Gemfile.lock
LICENSE
README.md
Rakefile
clever_elements.gemspec

README.md

clever_elements

Build Status

Under Development, any help appreciated!

clever_elements is a RubyGem to use the CleverElements SOAP Api with Ruby / Rails.

Rails 3 Quickstart

The easiest way to use clever_elements is with Rails 3. Just extend your Gemfile

gem 'clever_elements', '~> 0.0.1'

put a clever_elements.yml file in your #{Rails.root}/config:

user_id: <your user id>
api_key: <your api key>
mode: <test or live>

And use the CleverElements::List and CleverElements::Subscriber models, e.g.

# Get the ids of all lists in your account:
CleverElements::List.ids
# => ['73302']

# Get the list for a specific id:
CleverElements::List.find '73302'
# => <CleverElements::List:0x007fb78a8ab8f0 @id="73302", @name="ABC", @description="foobar", @subscriber="0", @unsubscriber="0">

# Get all lists in your account:
CleverElements::List.all
# => [<CleverElements::List:0x007fb78a8ab8f0 @id="73302", @name="ABC", @description="foobar", @subscriber="0", @unsubscriber="0">]

# Create a new list:
list = CleverElements::List.new :name => 'baz'
list.id
# => nil
list.create
# => true
list.id 
# => 73303

# Remove a list:
list = CleverElements::List.find('73302')
list.id
# => 73302
list.destroy
# => true
list.id
# => nil

# Get the subscribers in a list
list = CleverElements::List.find('73302')
list.subscriber
# => [<CleverElements::Subscriber:0x007fb78a8ab8f0 @id='123123', @email='max@muster.de'>]

# or
CleverElements::Subscriber.all '73302'
# => [<CleverElements::Subscriber:0x007fb78a8ab8f0 @id='123123', @email='max@muster.de'>]

# Add a subscriber
subscriber = list.create_subscriber :email => 'max@muster.de'
# => <CleverElements::Subscriber:0x007fb78a8ab8f0 @id='123143', @email='max@muster.de'>

# Unsubscribe
subscriber.unsubscribe_from_all

What doesn't work / hasn't been implemented yet?

  • custom fields
  • unsubscribe_from_list (implemented but API request doesn't work)

What could be improved?

  • extensions/wasabi_parser.rb
  • comprehensive exception handling
  • environment dependent configuration (development, test, production)
  • test / spec helpers
Something went wrong with that request. Please try again.