mandarinsoda / datamapper-mailchimp-adapter
- Source
- Commits
- Network (1)
- Issues (0)
- Downloads (0)
- Wiki (1)
- Graphs
-
Branch:
master
| name | age | message | |
|---|---|---|---|
| |
.gitignore | Mon Oct 27 16:30:37 -0700 2008 | |
| |
History.txt | Mon Sep 29 17:47:51 -0700 2008 | |
| |
LICENSE | Wed Oct 01 15:57:47 -0700 2008 | |
| |
Manifest.txt | Mon Sep 29 17:47:51 -0700 2008 | |
| |
README | Tue Oct 21 17:41:59 -0700 2008 | |
| |
Rakefile | Wed Oct 01 15:56:39 -0700 2008 | |
| |
dm-mailchimp-adapter.gemspec | Wed Oct 01 15:57:47 -0700 2008 | |
| |
lib/ | Wed Oct 29 13:29:13 -0700 2008 | |
| |
spec/ | Mon Sep 29 17:47:51 -0700 2008 |
README
dm-mailchimp-adapter by mandarinsoda http://mandarinsoda.com == DESCRIPTION: A Datamapper adapter to access the MailChimp mailing list web services. Slightly less big work in progress at the moment, as this is my first time digging into DM adapters. == FEATURES/PROBLEMS: This adapter currently supported the following features: - create will add a user to a specific MailChimp mailing list - delete will remove a user from a specific MailChimp mailing list - read_one will read the information for one user on a particular mailing - read_all will read the information for all users on a particular mailing list - udpdate will update a user's information on a particular list Still plenty to do and test (and write tests for dood mcgee's sakes) == SYNOPSIS: Setup database.yml with a mailchimp adapter: adapter: mailchimp database: '' username: mailchimp_user password: mailchimp_password mailing_list_id: list_id (optional - can specify in code as well) host: localhost Create a model that will hold attributes required by MailChimp APIs: class Mailee include DataMapper::Resource property :id, String, :serial => true, :key => true, :field => :_id property :first_name, String property :last_name, String property :email, String property :mailing_list_id, String #callback method used by adapter to build mail merge info for MailChimp def build_mail_merge() {"EMAIL" => self.email, "FNAME" => self.first_name, "LNAME" => self.last_name } end end Try it out....merb -i, for instance: m = Mailee.new m.first_name = 'dood' m.last_name = 'mcgee' m.email = 'doodmcgee@yahoo.com' m.mailing_list_id = '11232131231' m.create If it works, dood mcgee should get an opt-in email read_all = Mailee.all() read_one = mailee = Mailee.first(:email => 'doodmcgee@yahoo.com') delete = mailee.destroy update = mailee.update_attributes(:email => 'doodmcracken@yahoo.com') == REQUIREMENTS: - Implement and test basic adapter operations - Implement full Mail Chimp API == INSTALL: Download from github and run rake install
