Acts As Chimp plugin
Plugin details
Documentation
ruby script/plugin install git://github.com/matthewjcarlson/acts_as_chimp.git
This plugin is fairly stripped down at the moment and is directed at a fairly specific use case (aka: Sign up for our beta sorta deal). We're using restful_authentication for our use case and more or less are assuming you're doing the same (or have a similar setup with a user table - we're not dependent on that plugin, but its a damn good one if you're not using it).
We add user first name, last name and email address to our MailChimp mailing list, and we've likewise assumed you'll want to do the same. As such, we've provided a script to create a migration to add user first and last names to your users table if they're not already there. The sign-up forms are up to you and any additional fields are up to you.
After running the migrations, you can just add your credentials to the mail_chimp.yml file and then add the following to your user model:
acts_as_chimp :mailing_list_id => 'your_list_id'
and we'll take care of adding the user to the mail chimp list you specify with an after save callback.
If you need to figure out your mail chimp mail list id, we've provided some helper methods for you in the ChimpHelper class.
Prepare database
============
Generate and apply the migration if you need to:
script/generate acts_as_chimp_migration rake db:migrate
Example
=======
Interacting with the ChimpHelper to get your mailing list id:
Instantiate new helper:
c = ChimpHelper.new
Login to get authorized:
authorization_info = c.login('user', 'login')
Pass authorization info and mailing list name to method:
list = c.mailing_list_info(authorization_info,"Test")
In order to add a user to a mailing list. Add the following to your User model:
acts_as_chimp :mailing_list_id => 'your_list_id'
Your User model should have an email, first_name and last_name.
A user will be removed from a mailing list post_destroy as well.
Further Documentation
There is currently no advanced documentation for this plugin.
New documentationEdit plugin | (0 older versions) | Last edited by: hardway, over 2 years ago


