RackMonkeyParty
A rack endpoint for adding people to a mailchimp list
Installation and configuration
Add this line to your application's Gemfile:
gem 'rack_monkey_party'
And then execute:
$ bundle
Or install it yourself as:
$ gem install rack_monkey_party
Configure mailchimp parameters
MonkeyParty.api_key = 'an_api_key'
MonkeyParty.data_center = 'us1'
MonkeyParty.default_list = 'Your List Name'
Usage
Perform a post to the app with a JSON-based, subscriber payload
post "/", { "subscriber" => {"email" => "user@example.com" }}
If the request successfully processes,
you should receive a 201 (created) response.
This means that the email address was successfully added to the desired list
If something went wrong you should receive a 421 (unprocessable entity).
You will also receive the error message received from MailChimp.
{
email: "bademail",
error: {
message: "Invalid Email Address: bademail",
code: "502"
}
}
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Added some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request