Created
November 3, 2010 19:19
-
-
Save sbeam/661552 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require_dependency 'application_controller' | |
class MailChimpExtension < Spree::Extension | |
version "1.0" | |
description "Mail Chimp API integration with your Spree Store, using the hominid gem" | |
url "http://github.com/sbeam/spree-mail-chimp.git" | |
def self.require_gems(config) | |
config.gem 'hominid', '>= 2.2.0' | |
end | |
def activate | |
require 'hominid' # http://github.com/bgetting/hominid | |
UserController.send(:include, MailChimp::Sync) | |
User.class_eval do | |
attr_accessible :is_mail_list_subscriber | |
attr_protected :mailchimp_subscriber_id | |
end | |
# make our helper avaliable in all views | |
Spree::BaseController.class_eval do | |
helper MailChimpHelper | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment