Posts Tagged ‘api’

Mailbuild gem 1.1

Wednesday, September 3rd, 2008

I’ve pushed a small update to the Mailbuild gem this morning which adds support for multiple subscriber lists, enabling you to manage different types of subscribers from within your application.

The sample Rails application has also been updated to take into account the slightly changed syntax for specifying your list id(s);

Mailbuild.list_id = 'LIST_ID_HERE'

…is now…

Mailbuild.list_ids = {:newsletter = 'LIST_ID_HERE'}

All API calls take a list id as their last parameter, which defaults to the first id you declare in the list_ids hash.

You can use a specific subscriber list id as follows;

Mailbuild.add(params[:email], params[:name], Mailbuild.list_ids[:newsletter])

The documentation explains what parameters each method accepts.

A Ruby/Rails interface to Mailbuild API

Thursday, July 24th, 2008

I’m pleased to announce the release of the first version of my Mailbuild API interface, which I’m distributing as a Rubygem.

To make it easier to figure out how to use it, I’ve also created a fully functional Rails application which demonstrates all the API calls available.

To use it all you have to do is grab a copy from subversion…

svn co http://mailbuild.rubyforge.org/svn/rails_mailbuild_example/

… make sure you have the mailbuild gem installed …

cd rails_mailbuild_example
# OS X/Linux users may have to prefix this with sudo
rake gems:install

… and edit config/initializers/mailbuild.rb, adding your own API key, List ID and sub-domain.

# You can get this information from your Mailbuild admin
Mailbuild.api_key = ''
Mailbuild.list_id = ''
Mailbuild.subdomain = ''

Hopefully that’s all there is to it, but if you run into any problems feel free to add a support request or bug report on Rubyforge.